From ec27d573f492f30c1111678273d56f922330fdcd Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Oct 2015 15:52:08 +0100 Subject: audio: always log channel maps before determining final map Until now, this was done only in debug verbosity, while some AOs logged equivalent information in verbose mode. Clean this up. --- audio/chmap_sel.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'audio/chmap_sel.c') diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c index 292aa8e20b..51a3eecf8b 100644 --- a/audio/chmap_sel.c +++ b/audio/chmap_sel.c @@ -20,6 +20,7 @@ #include #include "common/common.h" +#include "common/msg.h" #include "chmap_sel.h" static const struct mp_chmap speaker_replacements[][2] = { @@ -357,3 +358,24 @@ bool mp_chmap_sel_get_def(const struct mp_chmap_sel *s, struct mp_chmap *map, } return map->num > 0; } + +// Print the set of allowed channel layouts. +void mp_chmal_sel_log(const struct mp_chmap_sel *s, struct mp_log *log, int lev) +{ + if (!mp_msg_test(log, lev)) + return; + + for (int i = 0; i < s->num_chmaps; i++) + mp_msg(log, lev, " - %s\n", mp_chmap_to_str(&s->chmaps[i])); + for (int i = 0; i < MP_SPEAKER_ID_COUNT; i++) { + if (!s->speakers[i]) + continue; + struct mp_chmap l = {.num = 1, .speaker = { i }}; + mp_msg(log, lev, " - #%s\n", + i == MP_SPEAKER_ID_FC ? "fc" : mp_chmap_to_str_hr(&l)); + } + if (s->allow_waveext) + mp_msg(log, lev, " - waveext\n"); + if (s->allow_any) + mp_msg(log, lev, " - anything\n"); +} -- cgit v1.2.3