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.
This commit is contained in:
wm4 2016-11-08 16:59:12 +01:00
parent 8f1ec91b45
commit 2b71bef2ba
1 changed files with 12 additions and 6 deletions

View File

@ -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);
}