player/Control: add method LockApplyBorderPause()
This commit is contained in:
parent
baa2bc0c38
commit
03151310cf
@ -351,6 +351,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
void LockSetBorderPause(bool border_pause);
|
void LockSetBorderPause(bool border_pause);
|
||||||
|
|
||||||
|
bool ApplyBorderPause() {
|
||||||
|
if (border_pause)
|
||||||
|
state = PlayerState::PAUSE;
|
||||||
|
return border_pause;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LockApplyBorderPause() {
|
||||||
|
const ScopeLock lock(mutex);
|
||||||
|
return ApplyBorderPause();
|
||||||
|
}
|
||||||
|
|
||||||
void Kill();
|
void Kill();
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
|
@ -948,18 +948,11 @@ Player::SongBorder()
|
|||||||
|
|
||||||
ActivateDecoder();
|
ActivateDecoder();
|
||||||
|
|
||||||
pc.Lock();
|
const bool border_pause = pc.LockApplyBorderPause();
|
||||||
|
|
||||||
const bool border_pause = pc.border_pause;
|
|
||||||
if (border_pause) {
|
if (border_pause) {
|
||||||
paused = true;
|
paused = true;
|
||||||
pc.state = PlayerState::PAUSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pc.Unlock();
|
|
||||||
|
|
||||||
if (border_pause)
|
|
||||||
idle_add(IDLE_PLAYER);
|
idle_add(IDLE_PLAYER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
Loading…
Reference in New Issue
Block a user