diff options
Diffstat (limited to '')
-rw-r--r-- | src/decoder/DecoderControl.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/decoder/DecoderControl.cxx b/src/decoder/DecoderControl.cxx index a4fe570b2..648e816d8 100644 --- a/src/decoder/DecoderControl.cxx +++ b/src/decoder/DecoderControl.cxx @@ -109,8 +109,19 @@ DecoderControl::Seek(SongTime t) { assert(state != DecoderState::START); - if (state == DecoderState::STOP || - state == DecoderState::ERROR || !seekable) + switch (state) { + case DecoderState::START: + gcc_unreachable(); + + case DecoderState::ERROR: + case DecoderState::STOP: + return false; + + case DecoderState::DECODE: + break; + } + + if (!seekable) return false; seek_time = t; |