diff options
author | Max Kellermann <max@duempel.org> | 2009-03-05 18:20:41 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-05 18:20:41 +0100 |
commit | efd606337e7ee4ca2ee017b0197c9245d8fd333d (patch) | |
tree | 259a83037f5210dcb57c1216e38330b508f659b6 /src/decoder/flac_plugin.c | |
parent | 74a2813d781ec2bc2c0f5e4534552d4d8e99557b (diff) | |
download | mpd-efd606337e7ee4ca2ee017b0197c9245d8fd333d.tar.gz mpd-efd606337e7ee4ca2ee017b0197c9245d8fd333d.tar.xz mpd-efd606337e7ee4ca2ee017b0197c9245d8fd333d.zip |
flac: check command after flac_process_single() failure
When the MPD core sends the decoder a command while
flac_process_single() is executed, this function fails. Abort the
decoder only if not seeking. This fixes a seeking bug.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/flac_plugin.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index ec9495fda..4308f025f 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -353,9 +353,6 @@ flac_decode_internal(struct decoder * decoder, } else cmd = decoder_get_command(decoder); - if (!flac_process_single(flac_dec)) - break; - if (cmd == DECODE_COMMAND_SEEK) { FLAC__uint64 seek_sample = decoder_seek_where(decoder) * data.audio_format.sample_rate + 0.5; @@ -368,6 +365,12 @@ flac_decode_internal(struct decoder * decoder, decoder_seek_error(decoder); } else if (flac_get_state(flac_dec) == flac_decoder_eof) break; + + if (!flac_process_single(flac_dec)) { + cmd = decoder_get_command(decoder); + if (cmd != DECODE_COMMAND_SEEK) + break; + } } if (cmd != DECODE_COMMAND_STOP) { flacPrintErroredState(flac_get_state(flac_dec)); |