summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-12 23:15:44 +0200
committerwm4 <wm4@nowhere>2015-06-12 23:15:44 +0200
commit6cc02658fa0285aadb73b18f314afb0a655dd791 (patch)
tree3596fc70e4be83d3f691f040a973e976302e30fa
parent5b269ce696f655358c28da11f17b6d86678cb729 (diff)
downloadmpv-6cc02658fa0285aadb73b18f314afb0a655dd791.tar.bz2
mpv-6cc02658fa0285aadb73b18f314afb0a655dd791.tar.xz
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.
-rw-r--r--audio/out/ao_alsa.c2
1 files changed, 2 insertions, 0 deletions
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));