summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-03-15 06:31:11 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-03-19 04:07:24 (GMT)
commit5e8685f221a0dfa5357812e9d2b49a61238550c3 (patch)
tree3cfa225281fda7f8cca1b9d45105b0024c6a1b64
parent8cc2e9aa27220248d8b1ba7730e712f27424fa79 (diff)
MythPlayer:: Remove some unnecessary decoder locking.
The decoder_change_lock is used by the decoder thread to prevent the main thread from deleting/recreating the decoder object while it is in use. It does not need to be used from the main thread. (cherry picked from commit 5ea8d18065886e262f0b2507ea7e99a0eb49bcc7)
-rw-r--r--mythtv/libs/libmythtv/mythplayer.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index 2052228..5fc3f1c 100644
--- a/mythtv/libs/libmythtv/mythplayer.cpp
+++ b/mythtv/libs/libmythtv/mythplayer.cpp
@@ -294,8 +294,6 @@ MythPlayer::~MythPlayer(void)
void MythPlayer::SetWatchingRecording(bool mode)
{
- QMutexLocker locker(&decoder_change_lock);
-
watchingrecording = mode;
if (decoder)
decoder->setWatchingRecording(mode);
@@ -343,7 +341,6 @@ bool MythPlayer::Pause(void)
PauseBuffer();
allpaused = decoderPaused && videoPaused && bufferPaused;
{
- QMutexLocker locker(&decoder_change_lock);
if (using_null_videoout && decoder)
decoder->UpdateFramesPlayed();
else if (videoOutput && !using_null_videoout)
@@ -1274,7 +1271,6 @@ void MythPlayer::ResetCaptions(void)
}
}
-// caller has decoder_changed_lock
void MythPlayer::DisableCaptions(uint mode, bool osd_msg)
{
textDisplayMode &= ~mode;
@@ -1315,7 +1311,6 @@ void MythPlayer::DisableCaptions(uint mode, bool osd_msg)
}
}
-// caller has decoder_changed_lock
void MythPlayer::EnableCaptions(uint mode, bool osd_msg)
{
QMutexLocker locker(&osdLock);
@@ -1411,7 +1406,6 @@ void MythPlayer::SetCaptionsEnabled(bool enable, bool osd_msg)
QStringList MythPlayer::GetTracks(uint type)
{
- QMutexLocker locker(&decoder_change_lock);
if (decoder)
return decoder->GetTracks(type);
return QStringList();
@@ -1420,7 +1414,6 @@ QStringList MythPlayer::GetTracks(uint type)
int MythPlayer::SetTrack(uint type, int trackNo)
{
int ret = -1;
- QMutexLocker locker(&decoder_change_lock);
if (!decoder)
return ret;
@@ -1476,7 +1469,6 @@ void MythPlayer::EnableSubtitles(bool enable)
int MythPlayer::GetTrack(uint type)
{
- QMutexLocker locker(&decoder_change_lock);
if (decoder)
return decoder->GetTrack(type);
return -1;
@@ -1484,23 +1476,21 @@ int MythPlayer::GetTrack(uint type)
int MythPlayer::ChangeTrack(uint type, int dir)
{
- QMutexLocker locker(&decoder_change_lock);
- if (decoder)
+ if (!decoder)
+ return -1;
+
+ int retval = decoder->ChangeTrack(type, dir);
+ if (retval >= 0)
{
- int retval = decoder->ChangeTrack(type, dir);
- if (retval >= 0)
- {
- SetOSDMessage(decoder->GetTrackDesc(type, GetTrack(type)),
- kOSDTimeout_Med);
- return retval;
- }
+ SetOSDMessage(decoder->GetTrackDesc(type, GetTrack(type)),
+ kOSDTimeout_Med);
+ return retval;
}
return -1;
}
void MythPlayer::ChangeCaptionTrack(int dir)
{
- QMutexLocker locker(&decoder_change_lock);
if (!decoder || (dir < 0))
return;