decoder/Control: use switch/case in Seek()

This commit is contained in:
Max Kellermann 2015-11-11 17:21:26 +01:00
parent c6d1d360a3
commit 27bfcda20d

View File

@ -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;