From ec3083948f6eac7ec594eac63de006bcf566bc87 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 29 Oct 2008 16:11:16 +0100 Subject: mp3: assert that the stream is seekable dc_seek() won't send a SEEK command to the decoder thread unless the stream is seekable. No need to do another check; convert that to an assertion. --- src/decoder/mp3_plugin.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/decoder/mp3_plugin.c b/src/decoder/mp3_plugin.c index bcf6f9566..29c0bde43 100644 --- a/src/decoder/mp3_plugin.c +++ b/src/decoder/mp3_plugin.c @@ -20,6 +20,7 @@ #include "../log.h" #include "../conf.h" +#include #include #include #include @@ -949,9 +950,11 @@ mp3_read(struct mp3_data *data, ReplayGainInfo **replay_gain_info_r) * all remaining samples */ return DECODE_BREAK; - if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK && - data->input_stream->seekable) { + if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) { unsigned long j = 0; + + assert(data->input_stream->seekable); + data->mute_frame = MUTEFRAME_SEEK; while (j < data->highest_frame && decoder_seek_where(decoder) > @@ -969,9 +972,6 @@ mp3_read(struct mp3_data *data, ReplayGainInfo **replay_gain_info_r) decoder_seek_error(decoder); data->mute_frame = MUTEFRAME_NONE; } - } else if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK && - !data->input_stream->seekable) { - decoder_seek_error(decoder); } } -- cgit v1.2.3