diff options
author | Max Kellermann <max@duempel.org> | 2008-10-29 16:11:16 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-29 16:11:16 +0100 |
commit | ec3083948f6eac7ec594eac63de006bcf566bc87 (patch) | |
tree | ab5332dbb673f4a84749b783b872ccdbb58e46b0 /src/decoder/mp3_plugin.c | |
parent | 78b08f03f2680350e4747b0769787856e564dd0d (diff) | |
download | mpd-ec3083948f6eac7ec594eac63de006bcf566bc87.tar.gz mpd-ec3083948f6eac7ec594eac63de006bcf566bc87.tar.xz mpd-ec3083948f6eac7ec594eac63de006bcf566bc87.zip |
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.
Diffstat (limited to 'src/decoder/mp3_plugin.c')
-rw-r--r-- | src/decoder/mp3_plugin.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 <assert.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> @@ -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); } } |