summaryrefslogtreecommitdiffstats
path: root/audio/chmap_sel.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-26 15:52:08 +0100
committerwm4 <wm4@nowhere>2015-10-26 15:52:08 +0100
commitec27d573f492f30c1111678273d56f922330fdcd (patch)
tree916878a99712de58e3e012d5536311340de8a97d /audio/chmap_sel.c
parent72d3c5ef00a71f4620279e0883c86894f145939d (diff)
downloadmpv-ec27d573f492f30c1111678273d56f922330fdcd.tar.bz2
mpv-ec27d573f492f30c1111678273d56f922330fdcd.tar.xz
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.
Diffstat (limited to 'audio/chmap_sel.c')
-rw-r--r--audio/chmap_sel.c22
1 files changed, 22 insertions, 0 deletions
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 <limits.h>
#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");
+}