From 1440037411507f6737df97b7262649874cee8ac2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 31 Aug 2011 19:26:01 +0200 Subject: [PATCH 1/4] libx264: use X264_THREADS_AUTO constant instead of 0. --- libavcodec/libx264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index bff29d892c..93ae88d852 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -476,7 +476,7 @@ static const AVClass class = { static const AVCodecDefault x264_defaults[] = { { "b", "0" }, - { "threads", "0" }, + { "threads", AV_STRINGIFY(X264_THREADS_AUTO) }, { NULL }, }; From bea5670a4f5e47a39edf18abbfafa2760e1d7132 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 23 Aug 2011 10:27:49 +0200 Subject: [PATCH 2/4] AVOptions: drop av_ prefix from static av_get_number(). --- libavutil/opt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 9c601a2cbb..707977a7a9 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -261,7 +261,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c return buf; } -static int av_get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum) +static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum) { const AVOption *o = av_opt_find(obj, name, NULL, 0, 0); void *dst; @@ -293,7 +293,7 @@ double av_get_double(void *obj, const char *name, const AVOption **o_out) double num=1; int den=1; - if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0) + if (get_number(obj, name, o_out, &num, &den, &intnum) < 0) return NAN; return num*intnum/den; } @@ -304,7 +304,7 @@ AVRational av_get_q(void *obj, const char *name, const AVOption **o_out) double num=1; int den=1; - if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0) + if (get_number(obj, name, o_out, &num, &den, &intnum) < 0) return (AVRational){0, 0}; if (num == 1.0 && (int)intnum == intnum) return (AVRational){intnum, den}; @@ -318,7 +318,7 @@ int64_t av_get_int(void *obj, const char *name, const AVOption **o_out) double num=1; int den=1; - if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0) + if (get_number(obj, name, o_out, &num, &den, &intnum) < 0) return -1; return num*intnum/den; } From 9bc9188e5873083bfb35c91688a229ae3d45ff4f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 1 Sep 2011 10:17:09 +0200 Subject: [PATCH 3/4] libmp3lame: fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FF_API_LAME_GLOBAL_OPTIONS => FF_API_LAME_GLOBAL_OPTS Thanks to Clément Bœsch for spotting. --- libavcodec/libmp3lame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index b46ce42fb0..f9d4277c9d 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -68,7 +68,7 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx) lame_set_VBR_quality(s->gfp, avctx->global_quality/(float)FF_QP2LAMBDA); } lame_set_bWriteVbrTag(s->gfp,0); -#if FF_API_LAME_GLOBAL_OPTIONS +#if FF_API_LAME_GLOBAL_OPTS s->reservoir = avctx->flags2 & CODEC_FLAG2_BIT_RESERVOIR; #endif lame_set_disable_reservoir(s->gfp, !s->reservoir); From 6248694861f0c414571fadba447a0c1cab95284e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 1 Sep 2011 03:46:04 +0200 Subject: [PATCH 4/4] avconv: fix some bugs introduced in 630902a1e1336e7ee0cf3dcbcb6eb07af8edf660 These caused scrambled error messages to be printed and floating point exceptions. For example when there was no decoder available for a stream. Signed-off-by: Anton Khirnov --- avconv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/avconv.c b/avconv.c index 22d54ad0ab..f5f4dea36f 100644 --- a/avconv.c +++ b/avconv.c @@ -1822,7 +1822,7 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb if (ist->decoding_needed) { AVCodec *codec = ist->dec; if (!codec) { - snprintf(error, sizeof(error), "Decoder (codec id %d) not found for input stream #%d.%d", + snprintf(error, error_len, "Decoder (codec id %d) not found for input stream #%d.%d", ist->st->codec->codec_id, ist->file_index, ist->st->index); return AVERROR(EINVAL); } @@ -1838,7 +1838,7 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb } if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) { - snprintf(error, sizeof(error), "Error while opening decoder for input stream #%d.%d", + snprintf(error, error_len, "Error while opening decoder for input stream #%d.%d", ist->file_index, ist->st->index); return AVERROR(EINVAL); } @@ -2150,7 +2150,7 @@ static int transcode_init(OutputFile *output_files, /* init input streams */ for (i = 0; i < nb_input_streams; i++) - if ((ret = init_input_stream(i, output_streams, nb_output_streams, error, sizeof(error)) < 0)) + if ((ret = init_input_stream(i, output_streams, nb_output_streams, error, sizeof(error))) < 0) goto dump_format; /* open files and write file headers */