diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 9c0ed7dccb4058c7fd56bdd1fea7e8acc685aec0..79360c225319969cbb31b7e76769a66a1ddac826 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -176,6 +176,11 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) AC3DecodeContext *s = avctx->priv_data; s->avctx = avctx; +#if FF_API_DRC_SCALE + if (avctx->drc_scale) + s->drc_scale = avctx->drc_scale; +#endif + ff_ac3_common_init(); ac3_tables_init(); ff_mdct_init(&s->imdct_256, 8, 1, 1.0); @@ -788,7 +793,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) do { if(get_bits1(gbc)) { s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)]-1.0) * - s->avctx->drc_scale)+1.0; + s->drc_scale)+1.0; } else if(blk == 0) { s->dynamic_range[i] = 1.0f; } diff --git a/libavcodec/options.c b/libavcodec/options.c index 5cd5cab708a54138b87696d6c98bc9a628444304..6469ea7e730d789341f29e6a40bd01e4d2edf8d9 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -447,7 +447,7 @@ static const AVOption options[]={ {"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, #endif #if FF_API_DRC_SCALE -{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {.dbl = 1.0 }, 0.0, 1.0, A|D}, +{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {.dbl = 0.0 }, 0.0, 1.0, A|D}, #endif #if FF_API_LAME_GLOBAL_OPTS {"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BIT_RESERVOIR }, INT_MIN, INT_MAX, A|E, "flags2"},