From 6cc02658fa0285aadb73b18f314afb0a655dd791 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 12 Jun 2015 23:15:44 +0200 Subject: ao_alsa: if possible, reorder device maps to std layouts Channel maps reported by the device as SND_CHMAP_TYPE_VAR can be freely reordered. We don't use this much (out of laziness), but in this case it's a simple way to reduce necessary reordering (which would be an extra libavresample invocation), and to make debug output more readable. --- audio/out/ao_alsa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio') diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index 316bdc0b3c..6ff39ffcb2 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -306,6 +306,8 @@ static bool query_chmaps(struct ao *ao, struct mp_chmap *chmap) mp_chmap_from_alsa(&entry, &maps[i]->map); if (mp_chmap_is_valid(&entry)) { + if (maps[i]->type == SND_CHMAP_TYPE_VAR) + mp_chmap_reorder_norm(&entry); MP_VERBOSE(ao, "Got supported channel map: %s (type %s)\n", mp_chmap_to_str(&entry), snd_pcm_chmap_type_name(maps[i]->type)); -- cgit v1.2.3