Use the -a52drc option also for the libavcodec decoder.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31286 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-05-30 16:46:31 +00:00
parent 971633b168
commit b19b09df54
5 changed files with 14 additions and 14 deletions

View File

@ -19,9 +19,8 @@
#ifndef MPLAYER_CFG_COMMON_OPTS_H
#define MPLAYER_CFG_COMMON_OPTS_H
#include "config.h"
#include "libmpcodecs/vd.h"
#include "osdep/priority.h"
// you may _not_ include any files here since this is included
// in the middle of an array declaration
// ------------------------- common options --------------------
{"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
@ -218,9 +217,7 @@
{"ignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"noignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 1, 0, NULL},
#ifdef CONFIG_LIBA52
{"a52drc", &a52_drc_level, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
#endif
{"a52drc", &drc_level, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
// ------------------------- codec/vfilter options --------------------

View File

@ -24,6 +24,10 @@
#include "m_config.h"
#include "m_option.h"
#include "libmpcodecs/ad.h"
#include "libmpcodecs/vd.h"
#include "osdep/priority.h"
extern char *mp_msg_charset;
extern int mp_msg_color;
extern int mp_msg_module;
@ -52,8 +56,6 @@ extern int reuse_socket;
extern int dvd_speed; /* stream/stream_dvd.c */
extern float a52_drc_level;
/* defined in libmpdemux: */
extern int hr_mp3_seek;
extern const m_option_t demux_rawaudio_opts[];

View File

@ -29,6 +29,8 @@
#include "libmpdemux/stheader.h"
#include "ad.h"
float drc_level = 1.0;
/* Missed vorbis, mad, dshow */
//extern ad_functions_t mpcodecs_ad_null;

View File

@ -75,6 +75,7 @@ static int init(sh_audio_t *sh_audio)
lavc_context = avcodec_alloc_context();
sh_audio->context=lavc_context;
lavc_context->drc_scale = drc_level;
lavc_context->sample_rate = sh_audio->samplerate;
lavc_context->bit_rate = sh_audio->i_bps * 8;
if(sh_audio->wf){

View File

@ -54,8 +54,6 @@ static uint32_t channel_map;
/** The output is multiplied by this var. Used for volume control */
static sample_t a52_level = 1;
/** The value of the -a52drc switch. */
float a52_drc_level = 1.0;
static int a52_drc_action = DRC_NO_ACTION;
static const ad_info_t info =
@ -136,8 +134,8 @@ int channels=0;
static sample_t dynrng_call (sample_t c, void *data)
{
// fprintf(stderr, "(%lf, %lf): %lf\n", (double)c, (double)a52_drc_level, (double)pow((double)c, a52_drc_level));
return pow((double)c, a52_drc_level);
// fprintf(stderr, "(%lf, %lf): %lf\n", (double)c, (double)drc_level, (double)pow((double)c, drc_level));
return pow((double)c, drc_level);
}
@ -207,10 +205,10 @@ static int init(sh_audio_t *sh_audio)
/* Init a52 dynrng */
if (a52_drc_level < 0.001) {
if (drc_level < 0.001) {
/* level == 0 --> no compression, init library without callback */
a52_drc_action = DRC_NO_COMPRESSION;
} else if (a52_drc_level > 0.999) {
} else if (drc_level > 0.999) {
/* level == 1 --> full compression, do nothing at all (library default = full compression) */
a52_drc_action = DRC_NO_ACTION;
} else {