aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-09 05:18:11 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-11 01:13:16 +0200
commit268b1eae227660a7778edaf5345750d18bca4018 (patch)
treef0a61a03589658eb71a814448832006938316640 /libavcodec
parent39b192b8e1c136dfc4f3b2a70655607711c5d17a (diff)
downloadffmpeg-268b1eae227660a7778edaf5345750d18bca4018.tar.gz
avcodec/mpegaudioenc_template: default to 384k bitrate as default
If 384k is too high for the samplerate, choose the closest possible Idea to increase the bitrate from: 46439e156219d27f059cf687743ba5aacf238b87 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegaudioenc_template.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mpegaudioenc_template.c b/libavcodec/mpegaudioenc_template.c
index 451d140444..ec837f3b87 100644
--- a/libavcodec/mpegaudioenc_template.c
+++ b/libavcodec/mpegaudioenc_template.c
@@ -112,6 +112,11 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
if (avpriv_mpa_bitrate_tab[s->lsf][1][i] == bitrate)
break;
}
+ if (i == 15 && !avctx->bit_rate) {
+ i = 14;
+ bitrate = avpriv_mpa_bitrate_tab[s->lsf][1][i];
+ avctx->bit_rate = bitrate * 1000;
+ }
if (i == 15){
av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
return AVERROR(EINVAL);
@@ -774,7 +779,7 @@ static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
static const AVCodecDefault mp2_defaults[] = {
- { "b", "128k" },
+ { "b", "0" },
{ NULL },
};