aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2014-03-03 23:33:23 +0100
committerMemphiz <memphis@machzwo.de>2014-03-03 23:33:23 +0100
commit352d013f8dd7a43be490a2468fbcc7fd8ebd865f (patch)
treec4b5616b5fb72bd85be7f50c5ccb00771d64397d
parenta122c65f7d9ccddb6502fd3ef4199b1ed1c013f9 (diff)
[osxsink] - detect digital outputs based on device name and make capable passthrough devices "AE_DEVTYPE_IEC958" for showing the passthrough options in the gui - fixes missing passthrough options on some special audio setups
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp
index a9e123dbb1..16baa0cb8f 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp
@@ -123,8 +123,21 @@ static void EnumerateDevices(CADeviceList &list)
format = AE_FMT_S16BE;
else
{
+ bool isDigital = CCoreAudioStream::IsDigitalOuptut(*j);
+
+ // if it is no digital stream per definition
+ // check if the device name suggests that it is digital
+ // (some hackintonshs are not so smart in announcing correct
+ // ca devices ...
+ if (!isDigital)
+ {
+ std::string devNameLower = device.m_deviceName;
+ StringUtils::ToLower(devNameLower);
+ isDigital = devNameLower.find("digital") != std::string::npos;
+ }
+
/* Passthrough is possible with a 2ch digital output */
- if (desc.mChannelsPerFrame == 2 && CCoreAudioStream::IsDigitalOuptut(*j))
+ if (desc.mChannelsPerFrame == 2 && isDigital)
{
if (desc.mSampleRate == 48000)
{
@@ -132,6 +145,10 @@ static void EnumerateDevices(CADeviceList &list)
device.m_dataFormats.push_back(AE_FMT_AC3);
if (!HasDataFormat(device.m_dataFormats, AE_FMT_DTS))
device.m_dataFormats.push_back(AE_FMT_DTS);
+
+ // treat it like optical - else ActiveAE
+ // won't enable the pass through options in the gui
+ device.m_deviceType = AE_DEVTYPE_IEC958;
}
else if (desc.mSampleRate == 192000)
{