From 8838bdc1e30bc76a446cefda47559c482cd1e2e6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 Dec 2017 14:28:56 +0100 Subject: [PATCH] player/Thread: move CommandFinished() call out of SeekDecoder(SongTime) Decouple this function from player command execution. --- src/player/Thread.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index 4145e42d8..d93a146a7 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -605,7 +605,6 @@ Player::SeekDecoder(SongTime seek_time) noexcept } catch (...) { /* decoder failure */ pc.SetError(PlayerError::DECODER, std::current_exception()); - pc.CommandFinished(); return false; } @@ -658,8 +657,10 @@ Player::SeekDecoder() noexcept /* send the SEEK command */ - if (!SeekDecoder(pc.seek_time)) + if (!SeekDecoder(pc.seek_time)) { + pc.CommandFinished(); return false; + } } pc.CommandFinished();