[MPlayer-cvslog] r31286 - in trunk: cfg-common-opts.h cfg-common.h libmpcodecs/ad.c libmpcodecs/ad_ffmpeg.c libmpcodecs/ad_liba52.c
reimar
subversion at mplayerhq.hu
Sun May 30 18:46:31 CEST 2010
Author: reimar
Date: Sun May 30 18:46:31 2010
New Revision: 31286
Log:
Use the -a52drc option also for the libavcodec decoder.
Modified:
trunk/cfg-common-opts.h
trunk/cfg-common.h
trunk/libmpcodecs/ad.c
trunk/libmpcodecs/ad_ffmpeg.c
trunk/libmpcodecs/ad_liba52.c
Modified: trunk/cfg-common-opts.h
==============================================================================
--- trunk/cfg-common-opts.h Sun May 30 16:29:18 2010 (r31285)
+++ trunk/cfg-common-opts.h Sun May 30 18:46:31 2010 (r31286)
@@ -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 --------------------
Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h Sun May 30 16:29:18 2010 (r31285)
+++ trunk/cfg-common.h Sun May 30 18:46:31 2010 (r31286)
@@ -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[];
Modified: trunk/libmpcodecs/ad.c
==============================================================================
--- trunk/libmpcodecs/ad.c Sun May 30 16:29:18 2010 (r31285)
+++ trunk/libmpcodecs/ad.c Sun May 30 18:46:31 2010 (r31286)
@@ -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;
Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c Sun May 30 16:29:18 2010 (r31285)
+++ trunk/libmpcodecs/ad_ffmpeg.c Sun May 30 18:46:31 2010 (r31286)
@@ -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){
Modified: trunk/libmpcodecs/ad_liba52.c
==============================================================================
--- trunk/libmpcodecs/ad_liba52.c Sun May 30 16:29:18 2010 (r31285)
+++ trunk/libmpcodecs/ad_liba52.c Sun May 30 18:46:31 2010 (r31286)
@@ -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 {
More information about the MPlayer-cvslog
mailing list