From c560f6ff0ab9aec70e53a268e2ff388a85ec3ca0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Dec 2016 18:03:16 +0100 Subject: audio: change how spdif codecs are selected Remove ad_spdif from the normal codec list, and select it explicitly. One goal was to decouple this from the normal codec selection, so they're less entangled and the decoder selection code can be simplified in the far future. This means spdif codec selection is now done explicitly via select_spdif_codec(). We can also remove the weird requirements on "dts" and "dts-hd" for the --audio-spdif option, and it can just do the right thing. Now both video and audio codecs consist of a single codec family each, vd_lavc and ad_lavc. --- common/codecs.c | 16 ---------------- common/codecs.h | 5 ----- 2 files changed, 21 deletions(-) (limited to 'common') diff --git a/common/codecs.c b/common/codecs.c index c0d99eb959..463811066c 100644 --- a/common/codecs.c +++ b/common/codecs.c @@ -130,22 +130,6 @@ struct mp_decoder_list *mp_select_decoders(struct mp_decoder_list *all, return list; } -// selection is a ","-separated list of decoders, all in the given family. -struct mp_decoder_list *mp_select_decoder_list(struct mp_decoder_list *all, - const char *codec, - const char *family, - const char *selection) -{ - struct mp_decoder_list *list = talloc_zero(NULL, struct mp_decoder_list); - bstr sel = bstr0(selection); - while (sel.len) { - bstr decoder; - bstr_split_tok(sel, ",", &decoder, &sel); - add_new(list, find_decoder(all, bstr0(family), decoder), codec); - } - return list; -} - void mp_append_decoders(struct mp_decoder_list *list, struct mp_decoder_list *a) { for (int n = 0; n < a->num_entries; n++) diff --git a/common/codecs.h b/common/codecs.h index 17316c85e9..3e9408eaad 100644 --- a/common/codecs.h +++ b/common/codecs.h @@ -37,11 +37,6 @@ struct mp_decoder_list *mp_select_decoders(struct mp_decoder_list *all, const char *codec, const char *selection); -struct mp_decoder_list *mp_select_decoder_list(struct mp_decoder_list *all, - const char *codec, - const char *family, - const char *selection); - void mp_append_decoders(struct mp_decoder_list *list, struct mp_decoder_list *a); struct mp_log; -- cgit v1.2.3