Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 mythtv/libs/libmythtv/mythplayer.cpp
12 mythtv/libs/libmythtv/mythplayer.cpp
@@ -2779,8 +2779,12 @@ void MythPlayer::DecoderPauseCheck(void)
2779 2779 UnpauseDecoder();
2780 2780 }
2781 2781
  2782 +//// FIXME - move the eof ownership back into MythPlayer
2782 2783 bool MythPlayer::GetEof(void)
2783 2784 {
  2785 + if (QThread::currentThread() == (QThread*)playerThread)
  2786 + return decoder ? decoder->GetEof() : true;
  2787 +
2784 2788 decoder_change_lock.lock();
2785 2789 bool eof = decoder ? decoder->GetEof() : true;
2786 2790 decoder_change_lock.unlock();
@@ -2789,11 +2793,19 @@ bool MythPlayer::GetEof(void)
2789 2793
2790 2794 void MythPlayer::SetEof(bool eof)
2791 2795 {
  2796 + if (QThread::currentThread() == (QThread*)playerThread)
  2797 + {
  2798 + if (decoder)
  2799 + decoder->SetEof(eof);
  2800 + return;
  2801 + }
  2802 +
2792 2803 decoder_change_lock.lock();
2793 2804 if (decoder)
2794 2805 decoder->SetEof(eof);
2795 2806 decoder_change_lock.unlock();
2796 2807 }
  2808 +//// FIXME end
2797 2809
2798 2810 void MythPlayer::DecoderLoop(bool pause)
2799 2811 {

0 comments on commit e291378

Please sign in to comment.
Something went wrong with that request. Please try again.