From 7f2b78846b1335f399ec93b578431e87e03a229c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 9 Jan 2015 03:58:47 +0100 Subject: ao_alsa: fix dtshd passthrough We must not try to remap channels with this. Whethever ALSA gives us, and whatever we do with it, the result will probably be nonsense. Untested, as I don't have the required hardware. --- audio/out/ao_alsa.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'audio/out') diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index eb9095cbbc..30c7b05a6f 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -478,7 +478,9 @@ static int init_device(struct ao *ao) CHECK_ALSA_ERROR("Unable to set access type"); struct mp_chmap dev_chmap = ao->channels; - if (query_chmaps(ao, &dev_chmap)) { + if (AF_FORMAT_IS_IEC61937(ao->format)) { + dev_chmap.num = 0; // disable chmap API + } else if (query_chmaps(ao, &dev_chmap)) { ao->channels = dev_chmap; } else { // Assume only stereo and mono are supported. @@ -567,7 +569,9 @@ static int init_device(struct ao *ao) MP_VERBOSE(ao, "which we understand as: %s\n", mp_chmap_to_str(&chmap)); - if (mp_chmap_is_valid(&chmap)) { + if (AF_FORMAT_IS_IEC61937(ao->format)) { + MP_VERBOSE(ao, "using spdif passthrough; ignoring the channel map.\n"); + } else if (mp_chmap_is_valid(&chmap)) { if (mp_chmap_equals(&chmap, &ao->channels)) { MP_VERBOSE(ao, "which is what we requested.\n"); } else if (chmap.num == ao->channels.num) { -- cgit v1.2.3