Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paplayer: avoid blocking in OpenFile, call QueueNextFile instead #4340

Merged
merged 1 commit into from Mar 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions xbmc/cores/paplayer/PAPlayer.cpp
Expand Up @@ -250,8 +250,19 @@ bool PAPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options)
m_isPaused = false; // Make sure to reset the pause state
}

if (!QueueNextFileEx(file, false))
return false;
// if audio engine is suspended i.e. by a DisplayLost event (HDMI), MakeStream
// waits until the engine is resumed. if we block the main thread here, it can't
// resume the engine after a DisplayReset event
if (CAEFactory::IsSuspended())
{
if (!QueueNextFile(file))
return false;
}
else
{
if (!QueueNextFileEx(file, false))
return false;
}

CSharedLock lock(m_streamsLock);
if (m_streams.size() == 2)
Expand Down