player/Thread: move CommandFinished() call out of SeekDecoder(SongTime)

Decouple this function from player command execution.
This commit is contained in:
Max Kellermann 2017-12-27 14:28:56 +01:00
parent d6386bc80f
commit 8838bdc1e3
1 changed files with 3 additions and 2 deletions

View File

@ -605,7 +605,6 @@ Player::SeekDecoder(SongTime seek_time) noexcept
} catch (...) { } catch (...) {
/* decoder failure */ /* decoder failure */
pc.SetError(PlayerError::DECODER, std::current_exception()); pc.SetError(PlayerError::DECODER, std::current_exception());
pc.CommandFinished();
return false; return false;
} }
@ -658,8 +657,10 @@ Player::SeekDecoder() noexcept
/* send the SEEK command */ /* send the SEEK command */
if (!SeekDecoder(pc.seek_time)) if (!SeekDecoder(pc.seek_time)) {
pc.CommandFinished();
return false; return false;
}
} }
pc.CommandFinished(); pc.CommandFinished();