Permalink
Browse files

Change the way we determine and set the passthrough device. We now ma…

…ke a difference between the 'auto' and the 'default' device. 'auto' is the default audio device but with extra settings for digital passthrough, 'default' is the same device as the main one. This is used when a passthru device is set manually, and in the case of hdmi, we do not try to set IEC bit provided it will fail anyway

git-svn-id: http://svn.mythtv.org/svn/trunk@27306 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent 5b5e335 commit cf50394621922473f6385a684e6f9f6a91c0da38 @jyavenard jyavenard committed Nov 20, 2010
@@ -46,15 +46,19 @@ AudioOutputALSA::AudioOutputALSA(const AudioSettings &settings) :
if (passthru_device == "auto")
{
passthru_device = main_device;
- if (!passthru_device.contains(":"))
- passthru_device += ":AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2";
+ if (passthru_device.contains(":"))
+ {
+ passthru_device += ",";
+ }
else
{
- passthru_device = passthru_device.insert(
- passthru_device.indexOf(":") + 1,
- "AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2,");
+ passthru_device += ":";
}
+ passthru_device += "AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2";
}
+ else if (passthru_device.toLower() == "default")
+ passthru_device = main_device;
+
InitSettings(settings);
if (settings.init)
Reconfigure(settings);
@@ -108,7 +108,7 @@ AudioOutputDX::AudioOutputDX(const AudioSettings &settings) :
{
timeBeginPeriod(1);
InitSettings(settings);
- if (passthru_device == "auto")
+ if (passthru_device == "auto" || passthru_device.toLower() == "default")
passthru_device = main_device;
if (settings.init)
Reconfigure(settings);
@@ -319,6 +319,9 @@ AudioOutputSettings* AudioOutputSettings::GetUsers(bool newcopy)
cur_channels = max_channels;
aosettings->SetBestSupportedChannels(cur_channels);
+ // do not passthrough stereo AC3 or stereo DTS
+ // this is required should we need to upmix and at this stage of the
+ // audio lifecycle, we don't know if we will upconvert or not
if (cur_channels <= 2)
bDTS = bAC3 = false;
aosettings->m_AC3 = bAC3;
@@ -103,14 +103,14 @@ AudioSettings::AudioSettings(
void AudioSettings::FixPassThrough(void)
{
- if (passthru_device.isEmpty() || passthru_device.toLower() == "default")
+ if (passthru_device.isEmpty())
passthru_device = "auto";
}
void AudioSettings::TrimDeviceType(void)
{
main_device.remove(0, 5);
- if (passthru_device != "auto")
+ if (passthru_device != "auto" && passthru_device.toLower() != "default")
passthru_device.remove(0, 5);
}

0 comments on commit cf50394

Please sign in to comment.