diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2018-05-05 16:01:06 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2018-05-07 17:02:54 +0300 |
commit | d171a15f91811e083b52a455fc67c79f676fae4b (patch) | |
tree | 9f335c81eac0465b05ff5556597b1f1ffa999d95 | |
parent | de38a209f41dd2668ff6a72c047caadacc0a71a5 (diff) | |
download | pulseaudio-d171a15f91811e083b52a455fc67c79f676fae4b.tar.gz |
core-format: fix TrueHD and DTS-HD channel maps
Since these formats use 8 channels, the channel map needs to be
configured to 8 channels as well.
-rw-r--r-- | src/pulsecore/core-format.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/pulsecore/core-format.c b/src/pulsecore/core-format.c index c3db2678a..862a74b5d 100644 --- a/src/pulsecore/core-format.c +++ b/src/pulsecore/core-format.c @@ -227,13 +227,21 @@ int pa_format_info_to_sample_spec_fake(const pa_format_info *f, pa_sample_spec * ss->format = PA_SAMPLE_S16LE; if ((f->encoding == PA_ENCODING_TRUEHD_IEC61937) || - (f->encoding == PA_ENCODING_DTSHD_IEC61937)) - ss->channels = 8; - else - ss->channels = 2; - - if (map) - pa_channel_map_init_stereo(map); + (f->encoding == PA_ENCODING_DTSHD_IEC61937)) { + ss->channels = 8; + if (map) { + /* We use the ALSA mapping, because most likely we will be using an + * ALSA sink. This doesn't really matter anyway, though, because + * the channel map doesn't affect anything with passthrough + * streams. The channel map just needs to be consistent with the + * sample spec's channel count. */ + pa_channel_map_init_auto(map, 8, PA_CHANNEL_MAP_ALSA); + } + } else { + ss->channels = 2; + if (map) + pa_channel_map_init_stereo(map); + } pa_return_val_if_fail(pa_format_info_get_prop_int(f, PA_PROP_FORMAT_RATE, &rate) == 0, -PA_ERR_INVALID); ss->rate = (uint32_t) rate; |