summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2014-03-25 11:49:25 +0100
committerwm4 <wm4@nowhere>2014-04-04 18:35:29 +0200
commite7977ec87574331510d11751551109cf4794084d (patch)
tree7826be39bdbdb19813931c22ae3022c181a50374 /audio
parent41ba6dad721e618c0e54315bd72ad28afbd7b622 (diff)
downloadmpv-e7977ec87574331510d11751551109cf4794084d.tar.bz2
mpv-e7977ec87574331510d11751551109cf4794084d.tar.xz
af: add replaygain_data field to af_stream and af_instance
Closes #664
Diffstat (limited to 'audio')
-rw-r--r--audio/decode/dec_audio.c2
-rw-r--r--audio/decode/dec_audio.h1
-rw-r--r--audio/filter/af.c1
-rw-r--r--audio/filter/af.h2
4 files changed, 6 insertions, 0 deletions
diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c
index b753043869..b44216ec00 100644
--- a/audio/decode/dec_audio.c
+++ b/audio/decode/dec_audio.c
@@ -215,6 +215,8 @@ int audio_init_filters(struct dec_audio *d_audio, int in_samplerate,
afs->metadata = d_audio->metadata;
+ afs->replaygain_data = d_audio->replaygain_data;
+
char *s_from = mp_audio_config_to_str(&afs->input);
char *s_to = mp_audio_config_to_str(&afs->output);
MP_VERBOSE(d_audio, "Building audio filter chain for %s -> %s...\n", s_from, s_to);
diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h
index 8e9a1bcd12..dc7446bd0d 100644
--- a/audio/decode/dec_audio.h
+++ b/audio/decode/dec_audio.h
@@ -37,6 +37,7 @@ struct dec_audio {
struct af_stream *afilter;
char *decoder_desc;
struct mp_tags *metadata;
+ struct replaygain_data *replaygain_data;
// set by decoder
struct mp_audio decoded; // format of decoded audio (no data, temporarily
// different from decode_buffer during format
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 1ef391fbbf..d2c4bae40e 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -205,6 +205,7 @@ static struct af_instance *af_create(struct af_stream *s, char *name,
.data = talloc_zero(af, struct mp_audio),
.log = mp_log_new(af, s->log, name),
.metadata = s->metadata,
+ .replaygain_data = s->replaygain_data,
};
struct m_config *config = m_config_from_obj_desc(af, s->log, &desc);
if (m_config_apply_defaults(config, name, s->opts->af_defs) < 0)
diff --git a/audio/filter/af.h b/audio/filter/af.h
index 9e424308b8..aa49963b28 100644
--- a/audio/filter/af.h
+++ b/audio/filter/af.h
@@ -60,6 +60,7 @@ struct af_instance {
const struct af_info *info;
struct mp_log *log;
struct mp_tags *metadata;
+ struct replaygain_data *replaygain_data;
int (*control)(struct af_instance *af, int cmd, void *arg);
void (*uninit)(struct af_instance *af);
/* flags is a bit mask of AF_FILTER_FLAG_* values
@@ -92,6 +93,7 @@ struct af_stream {
struct mp_log *log;
struct MPOpts *opts;
struct mp_tags *metadata;
+ struct replaygain_data *replaygain_data;
};
// Return values