summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-30 16:46:31 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-30 16:46:31 +0000
commitb19b09df5499b1c1b03968c0c372659b8e4dc9f6 (patch)
tree02ae61b0217d12ad0ad64996d982724a01ab9aa9
parent971633b168b062c8a46c54e19b238c367998defb (diff)
downloadmpv-b19b09df5499b1c1b03968c0c372659b8e4dc9f6.tar.bz2
mpv-b19b09df5499b1c1b03968c0c372659b8e4dc9f6.tar.xz
Use the -a52drc option also for the libavcodec decoder.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31286 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--cfg-common-opts.h9
-rw-r--r--cfg-common.h6
-rw-r--r--libmpcodecs/ad.c2
-rw-r--r--libmpcodecs/ad_ffmpeg.c1
-rw-r--r--libmpcodecs/ad_liba52.c10
5 files changed, 14 insertions, 14 deletions
diff --git a/cfg-common-opts.h b/cfg-common-opts.h
index 7c67ba0379..dbaee846c9 100644
--- a/cfg-common-opts.h
+++ b/cfg-common-opts.h
@@ -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 --------------------
diff --git a/cfg-common.h b/cfg-common.h
index b4e8d718a4..002d3ca528 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -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[];
diff --git a/libmpcodecs/ad.c b/libmpcodecs/ad.c
index f81f11ef0f..5febd7e5b9 100644
--- a/libmpcodecs/ad.c
+++ b/libmpcodecs/ad.c
@@ -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;
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index 9d1b8356ad..8dc7ab3ed0 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -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){
diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c
index 2e2006abc1..9b749a70ec 100644
--- a/libmpcodecs/ad_liba52.c
+++ b/libmpcodecs/ad_liba52.c
@@ -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 {