summaryrefslogtreecommitdiffstats
path: root/filters/f_decoder_wrapper.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-29 06:18:33 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-30 03:10:27 -0800
commit76e7e78ce989aad546310b9808cf7f96f23a281f (patch)
treee4432df6f925d2a1f9e5022373d359b626d9ea09 /filters/f_decoder_wrapper.h
parent054c02ad64a62dd8393bde0fd73edeaa71048722 (diff)
downloadmpv-76e7e78ce989aad546310b9808cf7f96f23a281f.tar.bz2
mpv-76e7e78ce989aad546310b9808cf7f96f23a281f.tar.xz
audio: move to decoder wrapper
Use the decoder wrapper that was introduced for video. This removes all code duplication the old audio decoder wrapper had with the video code. (The audio wrapper was copy pasted from the video one over a decade ago, and has been kept in sync ever since by the power of copy&paste. Since the original copy&paste was possibly done by someone who did not answer to the LGPL relicensing, this should also remove all doubts about whether any of this code is left, since we now completely remove any code that could possibly have been based on it.) There is some complication with spdif handling, and a minor behavior change (it will restrict the list of codecs to spdif if spdif is to be used), but there should not be any difference in practice.
Diffstat (limited to 'filters/f_decoder_wrapper.h')
-rw-r--r--filters/f_decoder_wrapper.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/filters/f_decoder_wrapper.h b/filters/f_decoder_wrapper.h
index 4d970bd79a..e6601052a2 100644
--- a/filters/f_decoder_wrapper.h
+++ b/filters/f_decoder_wrapper.h
@@ -46,6 +46,11 @@ struct mp_decoder_wrapper {
// Framedrop control for playback (not used for hr seek etc.)
int attempt_framedrops; // try dropping this many frames
int dropped_frames; // total frames _probably_ dropped
+
+ // --- for STREAM_AUDIO
+
+ // Prefer spdif wrapper over real decoders.
+ bool try_spdif;
};
// Create the decoder wrapper for the given stream, plus underlying decoder.
@@ -55,6 +60,7 @@ struct mp_decoder_wrapper *mp_decoder_wrapper_create(struct mp_filter *parent,
struct sh_stream *src);
struct mp_decoder_list *video_decoder_list(void);
+struct mp_decoder_list *audio_decoder_list(void);
// For precise seeking: if possible, try to drop frames up until the given PTS.
// This is automatically unset if the target is reached, or on reset.
@@ -96,9 +102,14 @@ struct mp_decoder_fns {
};
extern const struct mp_decoder_fns vd_lavc;
+extern const struct mp_decoder_fns ad_lavc;
+extern const struct mp_decoder_fns ad_spdif;
// Convenience wrapper for lavc based decoders. eof_flag must be set to false
// on init and resets.
void lavc_process(struct mp_filter *f, bool *eof_flag,
bool (*send)(struct mp_filter *f, struct demux_packet *pkt),
bool (*receive)(struct mp_filter *f, struct mp_frame *res));
+
+// ad_spdif.c
+struct mp_decoder_list *select_spdif_codec(const char *codec, const char *pref);