[FFmpeg-devel] [PATCH]Do not allow -b to override -ab

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Sep 22 14:15:40 CEST 2011


Hi!

I understand why the meaning of "-b" was changed, but I don't think users can 
expect this.
Fixes ticket 491.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/options.c b/libavcodec/options.c
index eb69904..94269e1 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -70,7 +70,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit, i
 #define AV_CODEC_DEFAULT_BITRATE 200*1000
 
 static const AVOption options[]={
-{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, A|V|E},
+{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, V|E},
 {"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, {.dbl = 128*1000 }, INT_MIN, INT_MAX, A|E},
 {"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), FF_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E},
 {"flags", NULL, OFFSET(flags), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"},
diff --git a/tests/codec-regression.sh b/tests/codec-regression.sh
index d89737b..c1955e7 100755
--- a/tests/codec-regression.sh
+++ b/tests/codec-regression.sh
@@ -295,7 +295,7 @@ do_audio_encoding ac3.rm "-vn -acodec ac3_fixed"
 fi
 
 if [ -n "$do_g726" ] ; then
-do_audio_encoding g726.wav "-b 32k -ac 1 -ar 8000 -acodec g726"
+do_audio_encoding g726.wav "-ab 32k -ac 1 -ar 8000 -acodec g726"
 do_audio_decoding
 fi
 


More information about the ffmpeg-devel mailing list