Permalink
Browse files

Merge pull request #4320 from Memphiz/osxsinkfinddigital

[osxsink] - detect digital outputs based on device name and make capable...
  • Loading branch information...
2 parents 88b9a0d + 352d013 commit f109a31fdaf5ae103446ba9f5d2f9bee43c1b22a @jmarshallnz jmarshallnz committed Mar 4, 2014
Showing with 18 additions and 1 deletion.
  1. +18 −1 xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp
@@ -123,15 +123,32 @@ 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)
{
if (!HasDataFormat(device.m_dataFormats, AE_FMT_AC3))
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)
{

0 comments on commit f109a31

Please sign in to comment.