From 2b71bef2ba865175497e2cc76d5d1ff2c2878271 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 8 Nov 2016 16:59:12 +0100 Subject: 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. --- audio/out/ao_alsa.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'audio') 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); } -- cgit v1.2.3