Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3367 from FernetMenta/aefixes

ActiveAE: fix opening wrong device after suspend
  • Loading branch information...
commit e8a8f38b8eb745570dd2ac7ee5960ae40c6864e4 2 parents 560146d + 6cd34b9
@FernetMenta FernetMenta authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
View
15 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
@@ -594,10 +594,13 @@ void CActiveAESink::GetDeviceFriendlyName(std::string &device)
void CActiveAESink::OpenSink()
{
+ // we need a copy of m_device here because ParseDevice and CreateDevice write back
+ // into this variable
+ std::string device = m_device;
std::string driver;
bool passthrough = AE_IS_RAW(m_requestedFormat.m_dataFormat);
- CAESinkFactory::ParseDevice(m_device, driver);
+ CAESinkFactory::ParseDevice(device, driver);
if (driver.empty() && m_sink)
driver = m_sink->GetName();
@@ -608,7 +611,7 @@ void CActiveAESink::OpenSink()
std::transform(sinkName.begin(), sinkName.end(), sinkName.begin(), ::toupper);
}
- if (!m_sink || sinkName != driver || !m_sink->IsCompatible(m_requestedFormat, m_device))
+ if (!m_sink || sinkName != driver || !m_sink->IsCompatible(m_requestedFormat, device))
{
CLog::Log(LOGINFO, "CActiveAE::OpenSink - sink incompatible, re-starting");
@@ -621,16 +624,16 @@ void CActiveAESink::OpenSink()
}
// get the display name of the device
- GetDeviceFriendlyName(m_device);
+ GetDeviceFriendlyName(device);
// if we already have a driver, prepend it to the device string
if (!driver.empty())
- m_device = driver + ":" + m_device;
+ device = driver + ":" + device;
// WARNING: this changes format and does not use passthrough
m_sinkFormat = m_requestedFormat;
- CLog::Log(LOGDEBUG, "CActiveAE::OpenSink - trying to open device %s", m_device.c_str());
- m_sink = CAESinkFactory::Create(m_device, m_sinkFormat, passthrough);
+ CLog::Log(LOGDEBUG, "CActiveAE::OpenSink - trying to open device %s", device.c_str());
+ m_sink = CAESinkFactory::Create(device, m_sinkFormat, passthrough);
if (!m_sink)
{
Please sign in to comment.
Something went wrong with that request. Please try again.