Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3200 from herrnst/appplayer-lock

ApplicationPlayer: Sanitize ClosePlayer() and SetPlaySpeed()
  • Loading branch information...
commit 421a4e84766a6097382c25e11506d8a6964b57b8 2 parents 5f6255f + 4926675
@fritsch fritsch authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 xbmc/ApplicationPlayer.cpp
View
16 xbmc/ApplicationPlayer.cpp
@@ -38,11 +38,11 @@ boost::shared_ptr<IPlayer> CApplicationPlayer::GetInternal() const
void CApplicationPlayer::ClosePlayer()
{
- CSingleLock lock(m_player_lock);
- if (m_pPlayer)
+ boost::shared_ptr<IPlayer> player = GetInternal();
+ if (player)
{
CloseFile();
- m_pPlayer.reset();
+ player.reset();
}
}
@@ -661,6 +661,10 @@ void CApplicationPlayer::GetScalingMethods(std::vector<int> &scalingMethods)
void CApplicationPlayer::SetPlaySpeed(int iSpeed, bool bApplicationMuted)
{
+ boost::shared_ptr<IPlayer> player = GetInternal();
+ if (!player)
+ return;
+
if (!IsPlayingAudio() && !IsPlayingVideo())
return ;
if (m_iPlaySpeed == iSpeed)
@@ -687,13 +691,13 @@ void CApplicationPlayer::SetPlaySpeed(int iSpeed, bool bApplicationMuted)
{
if (m_iPlaySpeed == 1)
{ // restore volume
- m_pPlayer->SetVolume(VOLUME_MAXIMUM);
+ player->SetVolume(VOLUME_MAXIMUM);
}
else
{ // mute volume
- m_pPlayer->SetVolume(VOLUME_MINIMUM);
+ player->SetVolume(VOLUME_MINIMUM);
}
- m_pPlayer->SetMute(bApplicationMuted);
+ player->SetMute(bApplicationMuted);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.