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.
  • Loading branch information...
commit e291378e42f4d2b309120f9f68b8ad2800347061 1 parent 5ea8d18
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
@@ -2779,8 +2779,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();
@@ -2789,11 +2793,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.