Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
076a8dfd41 | ||
![]() |
a9a8e5ca99 | ||
![]() |
c2a2ad133e | ||
![]() |
b6187e48db | ||
![]() |
8af11e51f2 | ||
![]() |
f597825052 | ||
![]() |
7d704f5127 | ||
![]() |
eb975b1c8b | ||
![]() |
84648d33ba | ||
![]() |
4b8a0b058d | ||
![]() |
1de90fd375 | ||
![]() |
c8b37fd03d | ||
![]() |
b37131f798 | ||
![]() |
878a7d1573 | ||
![]() |
bd968d260a | ||
![]() |
00c5cf4beb | ||
![]() |
6a57021cf9 | ||
![]() |
f20f79307b | ||
![]() |
d1bc77d86c | ||
![]() |
91d5da9321 | ||
![]() |
08ddfb77a1 | ||
![]() |
a0352d01e9 |
2
Doxyfile
2
Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.8.1
|
||||
PROJECT_NUMBER = 0.8.3
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
24
cmdutils.c
24
cmdutils.c
@@ -574,12 +574,13 @@ void show_banner(void)
|
||||
print_all_libs_info(stderr, INDENT|SHOW_VERSION);
|
||||
}
|
||||
|
||||
void show_version(void) {
|
||||
int opt_version(const char *opt, const char *arg) {
|
||||
printf("%s " FFMPEG_VERSION "\n", program_name);
|
||||
print_all_libs_info(stdout, SHOW_VERSION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_license(void)
|
||||
int opt_license(const char *opt, const char *arg)
|
||||
{
|
||||
printf(
|
||||
#if CONFIG_NONFREE
|
||||
@@ -646,9 +647,10 @@ void show_license(void)
|
||||
program_name, program_name, program_name
|
||||
#endif
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_formats(void)
|
||||
int opt_formats(const char *opt, const char *arg)
|
||||
{
|
||||
AVInputFormat *ifmt=NULL;
|
||||
AVOutputFormat *ofmt=NULL;
|
||||
@@ -695,9 +697,10 @@ void show_formats(void)
|
||||
name,
|
||||
long_name ? long_name:" ");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_codecs(void)
|
||||
int opt_codecs(const char *opt, const char *arg)
|
||||
{
|
||||
AVCodec *p=NULL, *p2;
|
||||
const char *last_name;
|
||||
@@ -771,9 +774,10 @@ void show_codecs(void)
|
||||
"even though both encoding and decoding are supported. For example, the h263\n"
|
||||
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
|
||||
"worse.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_bsfs(void)
|
||||
int opt_bsfs(const char *opt, const char *arg)
|
||||
{
|
||||
AVBitStreamFilter *bsf=NULL;
|
||||
|
||||
@@ -781,9 +785,10 @@ void show_bsfs(void)
|
||||
while((bsf = av_bitstream_filter_next(bsf)))
|
||||
printf("%s\n", bsf->name);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_protocols(void)
|
||||
int opt_protocols(const char *opt, const char *arg)
|
||||
{
|
||||
URLProtocol *up=NULL;
|
||||
|
||||
@@ -799,9 +804,10 @@ void show_protocols(void)
|
||||
up->url_write ? 'O' : '.',
|
||||
up->url_seek ? 'S' : '.',
|
||||
up->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_filters(void)
|
||||
int opt_filters(const char *opt, const char *arg)
|
||||
{
|
||||
AVFilter av_unused(**filter) = NULL;
|
||||
|
||||
@@ -810,9 +816,10 @@ void show_filters(void)
|
||||
while ((filter = av_filter_next(filter)) && *filter)
|
||||
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_pix_fmts(void)
|
||||
int opt_pix_fmts(const char *opt, const char *arg)
|
||||
{
|
||||
enum PixelFormat pix_fmt;
|
||||
|
||||
@@ -843,6 +850,7 @@ void show_pix_fmts(void)
|
||||
pix_desc->nb_components,
|
||||
av_get_bits_per_pixel(pix_desc));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_yesno(void)
|
||||
|
26
cmdutils.h
26
cmdutils.h
@@ -62,7 +62,7 @@ void uninit_opts(void);
|
||||
|
||||
/**
|
||||
* Trivial log callback.
|
||||
* Only suitable for show_help and similar since it lacks prefix handling.
|
||||
* Only suitable for opt_help and similar since it lacks prefix handling.
|
||||
*/
|
||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
|
||||
|
||||
@@ -177,50 +177,58 @@ void show_banner(void);
|
||||
* Print the version of the program to stdout. The version message
|
||||
* depends on the current versions of the repository and of the libav*
|
||||
* libraries.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_version(void);
|
||||
int opt_version(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print the license of the program to stdout. The license depends on
|
||||
* the license of the libraries compiled into the program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_license(void);
|
||||
int opt_license(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the formats supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_formats(void);
|
||||
int opt_formats(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the codecs supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_codecs(void);
|
||||
int opt_codecs(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the filters supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_filters(void);
|
||||
int opt_filters(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the bit stream filters supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_bsfs(void);
|
||||
int opt_bsfs(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the protocols supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_protocols(void);
|
||||
int opt_protocols(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the pixel formats supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_pix_fmts(void);
|
||||
int opt_pix_fmts(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Return a positive value if a line read from standard input
|
||||
|
@@ -1,13 +1,13 @@
|
||||
{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" },
|
||||
{ "L", OPT_EXIT, {(void*)opt_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)opt_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)opt_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)opt_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)opt_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
|
||||
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||
|
1
configure
vendored
1
configure
vendored
@@ -2537,6 +2537,7 @@ case $target_os in
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
|
||||
;;
|
||||
gnu)
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
;;
|
||||
qnx)
|
||||
add_cppflags -D_QNX_SOURCE
|
||||
|
23
ffmpeg.c
23
ffmpeg.c
@@ -343,6 +343,7 @@ typedef struct AVInputFile {
|
||||
int eof_reached; /* true if eof reached */
|
||||
int ist_index; /* index of first stream in ist_table */
|
||||
int buffer_size; /* current total buffer size */
|
||||
int nb_streams;
|
||||
} AVInputFile;
|
||||
|
||||
#if HAVE_TERMIOS_H
|
||||
@@ -2045,7 +2046,7 @@ static int transcode(AVFormatContext **output_files,
|
||||
int si = stream_maps[i].stream_index;
|
||||
|
||||
if (fi < 0 || fi > nb_input_files - 1 ||
|
||||
si < 0 || si > input_files[fi].ctx->nb_streams - 1) {
|
||||
si < 0 || si > input_files[fi].nb_streams - 1) {
|
||||
fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
@@ -2731,7 +2732,7 @@ static int transcode(AVFormatContext **output_files,
|
||||
}
|
||||
/* the following test is needed in case new streams appear
|
||||
dynamically in stream : we ignore them */
|
||||
if (pkt.stream_index >= input_files[file_index].ctx->nb_streams)
|
||||
if (pkt.stream_index >= input_files[file_index].nb_streams)
|
||||
goto discard_packet;
|
||||
ist_index = input_files[file_index].ist_index + pkt.stream_index;
|
||||
ist = &input_streams[ist_index];
|
||||
@@ -2944,7 +2945,7 @@ static int opt_frame_pix_fmt(const char *opt, const char *arg)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
} else {
|
||||
show_pix_fmts();
|
||||
opt_pix_fmts(NULL, NULL);
|
||||
ffmpeg_exit(0);
|
||||
}
|
||||
return 0;
|
||||
@@ -3468,6 +3469,7 @@ static int opt_input_file(const char *opt, const char *filename)
|
||||
input_files = grow_array(input_files, sizeof(*input_files), &nb_input_files, nb_input_files + 1);
|
||||
input_files[nb_input_files - 1].ctx = ic;
|
||||
input_files[nb_input_files - 1].ist_index = nb_input_streams - ic->nb_streams;
|
||||
input_files[nb_input_files - 1].nb_streams = ic->nb_streams;
|
||||
|
||||
top_field_first = -1;
|
||||
video_channel = 0;
|
||||
@@ -4074,16 +4076,18 @@ static void parse_matrix_coeffs(uint16_t *dest, const char *str)
|
||||
}
|
||||
}
|
||||
|
||||
static void opt_inter_matrix(const char *opt, const char *arg)
|
||||
static int opt_inter_matrix(const char *opt, const char *arg)
|
||||
{
|
||||
inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||
parse_matrix_coeffs(inter_matrix, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void opt_intra_matrix(const char *opt, const char *arg)
|
||||
static int opt_intra_matrix(const char *opt, const char *arg)
|
||||
{
|
||||
intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||
parse_matrix_coeffs(intra_matrix, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void show_usage(void)
|
||||
@@ -4093,7 +4097,7 @@ static void show_usage(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
AVCodec *c;
|
||||
AVOutputFormat *oformat = NULL;
|
||||
@@ -4148,6 +4152,7 @@ static void show_help(void)
|
||||
}
|
||||
|
||||
av_opt_show2(sws_opts, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_target(const char *opt, const char *arg)
|
||||
@@ -4378,11 +4383,13 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
|
||||
{
|
||||
}
|
||||
|
||||
static void opt_passlogfile(const char *opt, const char *arg)
|
||||
static int opt_passlogfile(const char *opt, const char *arg)
|
||||
{
|
||||
pass_logfilename_prefix = arg;
|
||||
#if CONFIG_LIBX264_ENCODER
|
||||
opt_default("passlogfile", arg);
|
||||
return opt_default("passlogfile", arg);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
7
ffplay.c
7
ffplay.c
@@ -212,7 +212,7 @@ typedef struct VideoState {
|
||||
int refresh;
|
||||
} VideoState;
|
||||
|
||||
static void show_help(void);
|
||||
static int opt_help(const char *opt, const char *arg);
|
||||
|
||||
/* options specified by the user */
|
||||
static AVInputFormat *file_iformat;
|
||||
@@ -1779,8 +1779,10 @@ static int video_thread(void *arg)
|
||||
|
||||
if (ret < 0) goto the_end;
|
||||
|
||||
#if CONFIG_AVFILTER
|
||||
if (!picref)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
pts = pts_int*av_q2d(is->video_st->time_base);
|
||||
|
||||
@@ -2950,7 +2952,7 @@ static void show_usage(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
show_usage();
|
||||
@@ -2982,6 +2984,7 @@ static void show_help(void)
|
||||
"down/up seek backward/forward 1 minute\n"
|
||||
"mouse click seek to percentage in file corresponding to fraction of width\n"
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Called from the main */
|
||||
|
@@ -353,7 +353,7 @@ static int opt_input_file(const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
show_usage();
|
||||
@@ -361,6 +361,7 @@ static void show_help(void)
|
||||
printf("\n");
|
||||
av_opt_show2(avformat_opts, NULL,
|
||||
AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void opt_pretty(void)
|
||||
|
@@ -4654,12 +4654,13 @@ static void opt_debug(void)
|
||||
logfilename[0] = '-';
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
printf("usage: ffserver [options]\n"
|
||||
"Hyper fast multi format Audio/Video streaming server\n");
|
||||
printf("\n");
|
||||
show_help_options(options, "Main options:\n", 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
|
@@ -571,6 +571,22 @@ static inline int binkb_get_value(BinkContext *c, int bundle_num)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline DCTELEM dequant(DCTELEM in, uint32_t quant, int dc)
|
||||
{
|
||||
/* Note: multiplication is unsigned but we want signed shift
|
||||
* otherwise clipping breaks.
|
||||
* TODO: The official decoder does not use clipping at all
|
||||
* but instead uses the full 32-bit result.
|
||||
* However clipping at least gets rid of the case that a
|
||||
* half-black half-white intra block gets black and white swapped
|
||||
* and should cause at most minor differences (except for DC). */
|
||||
int32_t res = in * quant;
|
||||
res >>= 11;
|
||||
if (!dc)
|
||||
res = av_clip_int16(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read 8x8 block of DCT coefficients.
|
||||
*
|
||||
@@ -669,10 +685,10 @@ static int read_dct_coeffs(GetBitContext *gb, DCTELEM block[64], const uint8_t *
|
||||
|
||||
quant = quant_matrices[quant_idx];
|
||||
|
||||
block[0] = (block[0] * quant[0]) >> 11;
|
||||
block[0] = dequant(block[0], quant[0], 1);
|
||||
for (i = 0; i < coef_count; i++) {
|
||||
int idx = coef_idx[i];
|
||||
block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
|
||||
block[scan[idx]] = dequant(block[scan[idx]], quant[idx], 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -115,7 +115,8 @@ static inline int get_ue_code(GetBitContext *gb, int order) {
|
||||
static int decode_residual_block(AVSContext *h, GetBitContext *gb,
|
||||
const struct dec_2dvlc *r, int esc_golomb_order,
|
||||
int qp, uint8_t *dst, int stride) {
|
||||
int i, level_code, esc_code, level, run, mask;
|
||||
int i, esc_code, level, mask;
|
||||
unsigned int level_code, run;
|
||||
DCTELEM level_buf[65];
|
||||
uint8_t run_buf[65];
|
||||
DCTELEM *block = h->block;
|
||||
@@ -124,6 +125,8 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
|
||||
level_code = get_ue_code(gb,r->golomb_order);
|
||||
if(level_code >= ESCAPE_CODE) {
|
||||
run = ((level_code - ESCAPE_CODE) >> 1) + 1;
|
||||
if(run > 64)
|
||||
return -1;
|
||||
esc_code = get_ue_code(gb,esc_golomb_order);
|
||||
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
|
||||
while(level > r->inc_limit)
|
||||
@@ -163,7 +166,7 @@ static inline int decode_residual_inter(AVSContext *h) {
|
||||
|
||||
/* get coded block pattern */
|
||||
int cbp= get_ue_golomb(&h->s.gb);
|
||||
if(cbp > 63){
|
||||
if(cbp > 63U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -189,7 +192,8 @@ static inline int decode_residual_inter(AVSContext *h) {
|
||||
|
||||
static int decode_mb_i(AVSContext *h, int cbp_code) {
|
||||
GetBitContext *gb = &h->s.gb;
|
||||
int block, pred_mode_uv;
|
||||
unsigned pred_mode_uv;
|
||||
int block;
|
||||
uint8_t top[18];
|
||||
uint8_t *left = NULL;
|
||||
uint8_t *d;
|
||||
@@ -222,7 +226,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
|
||||
/* get coded block pattern */
|
||||
if(h->pic_type == AV_PICTURE_TYPE_I)
|
||||
cbp_code = get_ue_golomb(gb);
|
||||
if(cbp_code > 63){
|
||||
if(cbp_code > 63U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -445,6 +449,8 @@ static inline int check_for_slice(AVSContext *h) {
|
||||
if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
|
||||
skip_bits_long(gb,24+align);
|
||||
h->stc = get_bits(gb,8);
|
||||
if (h->stc >= h->mb_height)
|
||||
return 0;
|
||||
decode_slice_header(h,gb);
|
||||
return 1;
|
||||
}
|
||||
@@ -659,7 +665,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
|
||||
buf_end = buf + buf_size;
|
||||
for(;;) {
|
||||
buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
|
||||
if(stc & 0xFFFFFE00)
|
||||
if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
|
||||
return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
|
||||
input_size = (buf_end - buf_ptr)*8;
|
||||
switch(stc) {
|
||||
|
@@ -380,7 +380,7 @@ uint64_t time= rdtsc();
|
||||
|
||||
|
||||
retry:
|
||||
if(s->divx_packed && s->xvid_build>=0 && s->bitstream_buffer_size){
|
||||
if(s->divx_packed && s->bitstream_buffer_size){
|
||||
int i;
|
||||
for(i=0; i<buf_size-3; i++){
|
||||
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){
|
||||
@@ -681,7 +681,7 @@ frame_end:
|
||||
int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
|
||||
int startcode_found=0;
|
||||
|
||||
if(buf_size - current_pos > 5){
|
||||
if(buf_size - current_pos > 7){
|
||||
int i;
|
||||
for(i=current_pos; i<buf_size-4; i++){
|
||||
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
|
||||
|
@@ -881,14 +881,19 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
|
||||
}
|
||||
}
|
||||
|
||||
if (s->restart_interval && show_bits(&s->gb, 8) == 0xFF){/* skip RSTn */
|
||||
--s->restart_count;
|
||||
if (s->restart_interval) --s->restart_count;
|
||||
i= 8+((-get_bits_count(&s->gb))&7);
|
||||
if (s->restart_interval && show_bits(&s->gb, i) == (1<<i)-1){ /* skip RSTn */
|
||||
int pos= get_bits_count(&s->gb);
|
||||
align_get_bits(&s->gb);
|
||||
while(show_bits(&s->gb, 8) == 0xFF)
|
||||
skip_bits(&s->gb, 8);
|
||||
skip_bits(&s->gb, 8);
|
||||
for (i=0; i<nb_components; i++) /* reset dc */
|
||||
s->last_dc[i] = 1024;
|
||||
if((get_bits(&s->gb, 8)&0xF8) == 0xD0){
|
||||
for (i=0; i<nb_components; i++) /* reset dc */
|
||||
s->last_dc[i] = 1024;
|
||||
}else{
|
||||
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -345,8 +345,8 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
|
||||
|
||||
#define DEFINE_LUT_FILTER(name_, description_, init_) \
|
||||
AVFilter avfilter_vf_##name_ = { \
|
||||
.name = NULL_IF_CONFIG_SMALL(#name_), \
|
||||
.description = description_, \
|
||||
.name = #name_, \
|
||||
.description = NULL_IF_CONFIG_SMALL(description_), \
|
||||
.priv_size = sizeof(LutContext), \
|
||||
\
|
||||
.init = init_, \
|
||||
|
@@ -232,6 +232,11 @@ static int config_props(AVFilterLink *outlink)
|
||||
if (!scale->sws)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
if (inlink->sample_aspect_ratio.num){
|
||||
outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, inlink->sample_aspect_ratio);
|
||||
} else
|
||||
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
@@ -233,8 +233,14 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
|
||||
|
||||
int cur_len = start_off + len_off - off;
|
||||
int prev_len = out_len;
|
||||
void *newbuf;
|
||||
out_len += cur_len;
|
||||
asf->buf = av_realloc(asf->buf, out_len);
|
||||
if(FFMIN(cur_len, len - off)<0)
|
||||
return -1;
|
||||
newbuf = av_realloc(asf->buf, out_len);
|
||||
if(!newbuf)
|
||||
return -1;
|
||||
asf->buf= newbuf;
|
||||
memcpy(asf->buf + prev_len, buf + off,
|
||||
FFMIN(cur_len, len - off));
|
||||
avio_skip(pb, cur_len);
|
||||
|
@@ -524,13 +524,19 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
|
||||
probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) {
|
||||
int ret, score = probe_size < max_probe_size ? AVPROBE_SCORE_MAX/4 : 0;
|
||||
int buf_offset = (probe_size == PROBE_BUF_MIN) ? 0 : probe_size>>1;
|
||||
void *buftmp;
|
||||
|
||||
if (probe_size < offset) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* read probe data */
|
||||
buf = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE);
|
||||
buftmp = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE);
|
||||
if(!buftmp){
|
||||
av_free(buf);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
buf=buftmp;
|
||||
if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) {
|
||||
/* fail if error was not end of file, otherwise, lower score */
|
||||
if (ret != AVERROR_EOF) {
|
||||
|
Reference in New Issue
Block a user