Skip to content

Commit

Permalink
Merge pull request xbmc#24740 from fritsch/pwhdmi
Browse files Browse the repository at this point in the history
AESinkPipewire: Properly identify HDMI devices
  • Loading branch information
fuzzard authored Mar 1, 2024
2 parents 99e0546 + c5e9708 commit d1f2c53
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d1f2c53

Please sign in to comment.