<dependency type="visible">
<and>
<condition setting="audiooutput.passthrough" operator="is">true</condition>
- <condition on="property" name="aesettingvisible" setting="audiooutput.config">audiooutput.passthrough</condition>
+ <condition on="property" name="aesettingvisible" setting="audiooutput.config">audiooutput.eac3passthrough</condition>
+ <condition on="property" name="aesettingvisible" setting="audiooutput.passthroughdevice">audiooutput.eac3passthrough</condition>
</and>
</dependency>
</dependencies>
bool CActiveAE::SupportsRaw(AEDataFormat format)
{
- if (!m_sink.HasPassthroughDevice())
+ if (!m_sink.SupportsFormat(CSettings::Get().GetString("audiooutput.passthroughdevice"), format))
return false;
- // those formats require HDMI
- if (format == AE_FMT_DTSHD || format == AE_FMT_TRUEHD)
- {
- if(m_sink.GetDeviceType(CSettings::Get().GetString("audiooutput.passthroughdevice")) != AE_DEVTYPE_HDMI)
- return false;
- }
-
- // TODO: check ELD?
return true;
}
}
else if (settingId == "audiooutput.truehdpassthrough")
{
- if (m_sink.HasPassthroughDevice() &&
- CSettings::Get().GetInt("audiooutput.config") != AE_CONFIG_FIXED &&
- m_sink.GetDeviceType(CSettings::Get().GetString("audiooutput.passthroughdevice")) == AE_DEVTYPE_HDMI)
+ if (m_sink.SupportsFormat(CSettings::Get().GetString("audiooutput.passthroughdevice"), AE_FMT_TRUEHD) &&
+ CSettings::Get().GetInt("audiooutput.config") != AE_CONFIG_FIXED)
return true;
}
else if (settingId == "audiooutput.dtshdpassthrough")
{
- if (m_sink.HasPassthroughDevice() &&
- CSettings::Get().GetInt("audiooutput.config") != AE_CONFIG_FIXED &&
- m_sink.GetDeviceType(CSettings::Get().GetString("audiooutput.passthroughdevice")) == AE_DEVTYPE_HDMI)
+ if (m_sink.SupportsFormat(CSettings::Get().GetString("audiooutput.passthroughdevice"), AE_FMT_DTSHD) &&
+ CSettings::Get().GetInt("audiooutput.config") != AE_CONFIG_FIXED)
+ return true;
+ }
+ else if (settingId == "audiooutput.eac3passthrough")
+ {
+ if (m_sink.SupportsFormat(CSettings::Get().GetString("audiooutput.passthroughdevice"), AE_FMT_EAC3) &&
+ CSettings::Get().GetInt("audiooutput.config") != AE_CONFIG_FIXED)
return true;
}
else if (settingId == "audiooutput.stereoupmix")
return false;
}
+bool CActiveAESink::SupportsFormat(const std::string &device, AEDataFormat format)
+{
+ std::string dev = device;
+ std::string dri;
+ CAESinkFactory::ParseDevice(dev, dri);
+ for (AESinkInfoList::iterator itt = m_sinkInfoList.begin(); itt != m_sinkInfoList.end(); ++itt)
+ {
+ for (AEDeviceInfoList::iterator itt2 = itt->m_deviceInfoList.begin(); itt2 != itt->m_deviceInfoList.end(); ++itt2)
+ {
+ CAEDeviceInfo& info = *itt2;
+ if (info.m_deviceName == dev)
+ {
+ AEDataFormatList::iterator itt3;
+ itt3 = find(info.m_dataFormats.begin(), info.m_dataFormats.end(), format);
+ if (itt3 != info.m_dataFormats.end())
+ return true;
+ else
+ return false;
+ }
+ }
+ }
+ return false;
+}
+
enum SINK_STATES
{
S_TOP = 0, // 0