Commit 27bfcda2 authored by Max Kellermann's avatar Max Kellermann

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

parent c6d1d360
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment