diff options
Diffstat (limited to 'libmpcodecs/ad_liba52.c')
-rw-r--r-- | libmpcodecs/ad_liba52.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c index 9b749a70ec..0cc282776d 100644 --- a/libmpcodecs/ad_liba52.c +++ b/libmpcodecs/ad_liba52.c @@ -24,9 +24,8 @@ #include <assert.h> #include "config.h" - +#include "options.h" #include "mp_msg.h" -#include "help_mp.h" #include "mpbswap.h" #include "ad_internal.h" @@ -134,8 +133,9 @@ int channels=0; static sample_t dynrng_call (sample_t c, void *data) { -// fprintf(stderr, "(%lf, %lf): %lf\n", (double)c, (double)drc_level, (double)pow((double)c, drc_level)); - return pow((double)c, drc_level); + struct MPOpts *opts = data; + //fprintf(stderr, "(%lf, %lf): %lf\n", (double)c, opts->drc_level, pow(c, opts->drc_level)); + return pow(c, opts->drc_level); } @@ -176,6 +176,7 @@ static int a52_resample_float(float *in, int16_t *out) static int init(sh_audio_t *sh_audio) { + struct MPOpts *opts = sh_audio->opts; uint32_t a52_accel=0; sample_t level=a52_level, bias=384; int flags=0; @@ -203,12 +204,11 @@ static int init(sh_audio_t *sh_audio) return 0; } - /* Init a52 dynrng */ - if (drc_level < 0.001) { + if (opts->drc_level < 0.001) { /* level == 0 --> no compression, init library without callback */ a52_drc_action = DRC_NO_COMPRESSION; - } else if (drc_level > 0.999) { + } else if (opts->drc_level > 0.999 || opts->drc_level < 1.001) { /* level == 1 --> full compression, do nothing at all (library default = full compression) */ a52_drc_action = DRC_NO_ACTION; } else { @@ -327,7 +327,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m if (a52_drc_action == DRC_NO_COMPRESSION) a52_dynrng(a52_state, NULL, NULL); else - a52_dynrng(a52_state, dynrng_call, NULL); + a52_dynrng(a52_state, dynrng_call, sh_audio->opts); } len=0; |