aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2024-03-01 13:11:38 +1000
committerGitHub <noreply@github.com>2024-03-01 13:11:38 +1000
commitd1f2c5368247663b53e5bcac0c3b4459b9a60f4f (patch)
tree7def43a3b113c204e9cc715a35c3857e4fe993e3
parent99e0546427d86e9d1427073f604abe7854777b08 (diff)
parentc5e9708e3d22d58da6843d2f490c1de579e48649 (diff)
Merge pull request #24740 from fritsch/pwhdmi
AESinkPipewire: Properly identify HDMI devices
-rw-r--r--xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp b/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
index 0b76c339de..d06b1ec579 100644
--- a/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
@@ -348,10 +348,25 @@ void CAESinkPipewire::EnumerateDevicesEx(AEDeviceInfoList& list, bool force)
streamTypes.end());
}
- if (device.m_channels.Count() == 2 && !device.m_streamTypes.empty())
+ // 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_deviceType = AE_DEVTYPE_IEC958;
device.m_dataFormats.emplace_back(AE_FMT_RAW);
+ if (!hasHBRFormat && device.m_channels.Count() == 2)
+ {
+ device.m_deviceType = AE_DEVTYPE_IEC958;
+ }
+ else
+ {
+ device.m_deviceType = AE_DEVTYPE_HDMI;
+ }
}
list.emplace_back(device);