summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-11-08 16:59:12 +0100
committerwm4 <wm4@nowhere>2016-11-08 16:59:12 +0100
commit2b71bef2ba865175497e2cc76d5d1ff2c2878271 (patch)
tree11117a69a0586b101782c52973905fdaf32485b0 /audio
parent8f1ec91b4502ee5bb3d0e104f9d21fb09e10d64f (diff)
downloadmpv-2b71bef2ba865175497e2cc76d5d1ff2c2878271.tar.bz2
mpv-2b71bef2ba865175497e2cc76d5d1ff2c2878271.tar.xz
ao_alsa: slightly better debug logging
Try to make it more compact, and also always list the reordered layout, but only if it's actually different. Should be the same functionally.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_alsa.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 90250c9855..de41954bd9 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -376,12 +376,18 @@ static bool query_chmaps(struct ao *ao, struct mp_chmap *chmap)
struct mp_chmap entry;
if (mp_chmap_from_alsa(&entry, &maps[i]->map)) {
struct mp_chmap reorder = entry;
- if (maps[i]->type == SND_CHMAP_TYPE_VAR)
- mp_chmap_reorder_norm(&reorder);
- MP_DBG(ao, "Got supported channel map: %s (type %s) -> %s -> %s\n",
- aname, snd_pcm_chmap_type_name(maps[i]->type),
- mp_chmap_to_str(&entry), mp_chmap_to_str(&reorder));
- mp_chmap_sel_add_map(&chmap_sel, &reorder);
+ mp_chmap_reorder_norm(&reorder);
+
+ MP_DBG(ao, "got ALSA chmap: %s (%s) -> %s", aname,
+ snd_pcm_chmap_type_name(maps[i]->type),
+ mp_chmap_to_str(&entry));
+ if (!mp_chmap_equals(&entry, &reorder))
+ MP_DBG(ao, " -> %s", mp_chmap_to_str(&reorder));
+ MP_DBG(ao, "\n");
+
+ struct mp_chmap final =
+ maps[i]->type == SND_CHMAP_TYPE_VAR ? reorder : entry;
+ mp_chmap_sel_add_map(&chmap_sel, &final);
} else {
MP_VERBOSE(ao, "skipping unknown ALSA channel map: %s\n", aname);
}