diff options
author | fritsch <Peter.Fruehberger@gmail.com> | 2024-02-21 06:01:13 +0100 |
---|---|---|
committer | fritsch <Peter.Fruehberger@gmail.com> | 2024-02-24 16:32:48 +0100 |
commit | c5e9708e3d22d58da6843d2f490c1de579e48649 (patch) | |
tree | 79b5f18a9cec8ab910261adaf450e662ce454f90 | |
parent | 2e36b7522bae549cdad38a6b4bc04dec5629f954 (diff) |
AESinkPipewire: Fix Passthrough channel availability
It seems the Pipewire can easily configure TrueHD as IEC Format while
only two channels are available. This is not correct. As later on when AE
starts playing 8 channels are opened, already enumerate properly.
Co-authored-by: Lukas Rusak <lorusak@gmail.com>
Co-authored-by: Markus Härer <markus.haerer@gmx.net>
-rw-r--r-- | xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp b/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp index 062676a16e..d06b1ec579 100644 --- a/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp +++ b/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp @@ -348,10 +348,18 @@ void CAESinkPipewire::EnumerateDevicesEx(AEDeviceInfoList& list, bool force) streamTypes.end()); } + // If DTS-HD-MA or TrueHD are configured 8 channels are needed + bool hasHBRFormat = std::any_of(device.m_streamTypes.cbegin(), device.m_streamTypes.cend(), + [](const auto& streamType) + { + return streamType == CAEStreamInfo::STREAM_TYPE_TRUEHD || + streamType == CAEStreamInfo::STREAM_TYPE_DTSHD_MA; + }); + if (!device.m_streamTypes.empty()) { device.m_dataFormats.emplace_back(AE_FMT_RAW); - if (device.m_channels.Count() == 2) + if (!hasHBRFormat && device.m_channels.Count() == 2) { device.m_deviceType = AE_DEVTYPE_IEC958; } |