summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-03-15 06:44:11 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-03-19 04:08:42 (GMT)
commitccc89dd1ce3e45a1cd8c5bf32fb95e2618f58ae1 (patch)
treecd6e2cba7b9d4c557e6ed114b82518d7c914285d
parent5e8685f221a0dfa5357812e9d2b49a61238550c3 (diff)
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 e291378e42f4d2b309120f9f68b8ad2800347061)
-rw-r--r--mythtv/libs/libmythtv/mythplayer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index 5fc3f1c..2a44e79 100644
--- a/mythtv/libs/libmythtv/mythplayer.cpp
+++ b/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)
{