mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/libtwolame: fix encoding lsf with defaults
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a2de7b1bd5
commit
5ab51f7535
|
@ -77,6 +77,10 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx)
|
||||||
twolame_set_num_channels(s->glopts, avctx->channels);
|
twolame_set_num_channels(s->glopts, avctx->channels);
|
||||||
twolame_set_in_samplerate(s->glopts, avctx->sample_rate);
|
twolame_set_in_samplerate(s->glopts, avctx->sample_rate);
|
||||||
twolame_set_out_samplerate(s->glopts, avctx->sample_rate);
|
twolame_set_out_samplerate(s->glopts, avctx->sample_rate);
|
||||||
|
|
||||||
|
if (!avctx->bit_rate)
|
||||||
|
avctx->bit_rate = avctx->sample_rate < 28000 ? 160000 : 384000;
|
||||||
|
|
||||||
if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
|
if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
|
||||||
twolame_set_VBR(s->glopts, TRUE);
|
twolame_set_VBR(s->glopts, TRUE);
|
||||||
twolame_set_VBR_level(s->glopts,
|
twolame_set_VBR_level(s->glopts,
|
||||||
|
@ -190,7 +194,7 @@ static const AVClass twolame_class = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const AVCodecDefault twolame_defaults[] = {
|
static const AVCodecDefault twolame_defaults[] = {
|
||||||
{ "b", "384000" },
|
{ "b", "0" },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue