Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MythPlayer: Only lock the eof check when run from the decoder thread.

Again, the decoder_change_lock only needs to be used from the decoder
thread. Prepares the way for some locking improvements.

I've added a fixme as a reminder to move the eof variable ownership back
into the player which removes the need for the lock.
(cherry picked from commit e291378)
  • Loading branch information...
commit ccc89dd1ce3e45a1cd8c5bf32fb95e2618f58ae1 1 parent 5e8685f
Mark Kendall authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 mythtv/libs/libmythtv/mythplayer.cpp
View
12 mythtv/libs/libmythtv/mythplayer.cpp
@@ -2742,8 +2742,12 @@ void MythPlayer::DecoderPauseCheck(void)
UnpauseDecoder();
}
+//// FIXME - move the eof ownership back into MythPlayer
bool MythPlayer::GetEof(void)
{
+ if (QThread::currentThread() == (QThread*)playerThread)
+ return decoder ? decoder->GetEof() : true;
+
decoder_change_lock.lock();
bool eof = decoder ? decoder->GetEof() : true;
decoder_change_lock.unlock();
@@ -2752,11 +2756,19 @@ bool MythPlayer::GetEof(void)
void MythPlayer::SetEof(bool eof)
{
+ if (QThread::currentThread() == (QThread*)playerThread)
+ {
+ if (decoder)
+ decoder->SetEof(eof);
+ return;
+ }
+
decoder_change_lock.lock();
if (decoder)
decoder->SetEof(eof);
decoder_change_lock.unlock();
}
+//// FIXME end
void MythPlayer::DecoderLoop(bool pause)
{
Please sign in to comment.
Something went wrong with that request. Please try again.