player/Thread: move player_command_finished() to PlayerControl
This commit is contained in:
parent
e6b37703da
commit
3a387643b3
@ -263,6 +263,12 @@ struct PlayerControl {
|
|||||||
ClientSignal();
|
ClientSignal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LockCommandFinished() {
|
||||||
|
Lock();
|
||||||
|
CommandFinished();
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Wait for the command to be finished by the player thread.
|
* Wait for the command to be finished by the player thread.
|
||||||
|
@ -310,14 +310,6 @@ public:
|
|||||||
void Run();
|
void Run();
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
|
||||||
player_command_finished(PlayerControl &pc)
|
|
||||||
{
|
|
||||||
pc.Lock();
|
|
||||||
pc.CommandFinished();
|
|
||||||
pc.Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Player::StartDecoder(MusicPipe &_pipe)
|
Player::StartDecoder(MusicPipe &_pipe)
|
||||||
{
|
{
|
||||||
@ -581,7 +573,7 @@ Player::SeekDecoder()
|
|||||||
while (decoder_starting) {
|
while (decoder_starting) {
|
||||||
if (!CheckDecoderStartup()) {
|
if (!CheckDecoderStartup()) {
|
||||||
/* decoder failure */
|
/* decoder failure */
|
||||||
player_command_finished(pc);
|
pc.LockCommandFinished();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -597,13 +589,13 @@ Player::SeekDecoder()
|
|||||||
|
|
||||||
if (!dc.Seek(where + start_time)) {
|
if (!dc.Seek(where + start_time)) {
|
||||||
/* decoder failure */
|
/* decoder failure */
|
||||||
player_command_finished(pc);
|
pc.LockCommandFinished();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
elapsed_time = where;
|
elapsed_time = where;
|
||||||
|
|
||||||
player_command_finished(pc);
|
pc.LockCommandFinished();
|
||||||
|
|
||||||
assert(xfade_state == CrossFadeState::UNKNOWN);
|
assert(xfade_state == CrossFadeState::UNKNOWN);
|
||||||
|
|
||||||
@ -1190,7 +1182,7 @@ player_task(void *arg)
|
|||||||
|
|
||||||
pc.outputs.Close();
|
pc.outputs.Close();
|
||||||
|
|
||||||
player_command_finished(pc);
|
pc.LockCommandFinished();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PlayerCommand::CANCEL:
|
case PlayerCommand::CANCEL:
|
||||||
|
Loading…
Reference in New Issue
Block a user