diff options
author | wm4 <wm4@nowhere> | 2015-01-09 03:58:47 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:19 +0900 |
commit | c56b237b3c20d22826920616bf70a1713812d3cc (patch) | |
tree | 0f879cf68fdbfef57f4698eff61b7d7b32407eb7 | |
parent | 63e401ccc9d949a951b00502fd6c9e24962258eb (diff) | |
download | mpv-c56b237b3c20d22826920616bf70a1713812d3cc.tar.bz2 mpv-c56b237b3c20d22826920616bf70a1713812d3cc.tar.xz |
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.
-rw-r--r-- | audio/out/ao_alsa.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index a828bcd96b..9669619b3f 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -539,7 +539,9 @@ static int init(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 { dev_chmap.num = 0; @@ -627,7 +629,9 @@ static int init(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) { |