Commit 7b7340f7 authored by Max Kellermann's avatar Max Kellermann

mp3: fix SEEK command check after mp3_synth_and_send()

mp3 seeking was broken, because the command==SEEK check was never reached. Swap the command check order (==SEEK before !=NONE) to fix that.
parent 2dacd16b
...@@ -994,10 +994,7 @@ mp3_read(struct mp3_data *data, struct replay_gain_info **replay_gain_info_r) ...@@ -994,10 +994,7 @@ mp3_read(struct mp3_data *data, struct replay_gain_info **replay_gain_info_r)
cmd = mp3_synth_and_send(data, cmd = mp3_synth_and_send(data,
replay_gain_info_r != NULL replay_gain_info_r != NULL
? *replay_gain_info_r : NULL); ? *replay_gain_info_r : NULL);
if (cmd != DECODE_COMMAND_NONE) if (cmd == DECODE_COMMAND_SEEK) {
return false;
if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
unsigned long j; unsigned long j;
assert(data->input_stream->seekable); assert(data->input_stream->seekable);
...@@ -1015,7 +1012,8 @@ mp3_read(struct mp3_data *data, struct replay_gain_info **replay_gain_info_r) ...@@ -1015,7 +1012,8 @@ mp3_read(struct mp3_data *data, struct replay_gain_info **replay_gain_info_r)
data->mute_frame = MUTEFRAME_SEEK; data->mute_frame = MUTEFRAME_SEEK;
decoder_command_finished(decoder); decoder_command_finished(decoder);
} }
} } else if (cmd != DECODE_COMMAND_NONE)
return false;
} }
while (true) { while (true) {
......
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