From 04e14ec8f69c66681808609046111bc225119e8e Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Wed, 12 Mar 2014 10:41:52 +0100 Subject: af: add metadata field to af_stream and af_instance This allows to propagate metadata information to audio filters. Closes #632 --- audio/decode/dec_audio.c | 2 ++ audio/decode/dec_audio.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'audio/decode') diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index ad9ccb504e..b753043869 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -213,6 +213,8 @@ int audio_init_filters(struct dec_audio *d_audio, int in_samplerate, mp_audio_set_channels(&afs->output, out_channels); mp_audio_set_format(&afs->output, *out_format); + afs->metadata = d_audio->metadata; + 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 c17a3baca3..8e9a1bcd12 100644 --- a/audio/decode/dec_audio.h +++ b/audio/decode/dec_audio.h @@ -21,6 +21,7 @@ #include "audio/chmap.h" #include "audio/audio.h" +#include "demux/demux.h" #include "demux/stheader.h" struct mp_audio_buffer; @@ -35,6 +36,7 @@ struct dec_audio { struct mp_audio_buffer *decode_buffer; struct af_stream *afilter; char *decoder_desc; + struct mp_tags *metadata; // set by decoder struct mp_audio decoded; // format of decoded audio (no data, temporarily // different from decode_buffer during format -- cgit v1.2.3