aboutsummaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-11 12:47:43 +0100
committerMax Kellermann <max@duempel.org>2012-02-11 12:57:18 +0100
commitd95db286953d9a678b88c3539bec382a57082ee4 (patch)
tree72e3cb6a388278c94744eda91584a985020e4783 /src/decoder
parent851fb16e7cc355e0b3b9c115b4fd12f866f28203 (diff)
decoder/flac: check for errors only after _process_single()
The only other libFLAC call (seek) does not produce fatal errors.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/flac_decoder_plugin.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/decoder/flac_decoder_plugin.c b/src/decoder/flac_decoder_plugin.c
index e8e93ff3..9dc1898d 100644
--- a/src/decoder/flac_decoder_plugin.c
+++ b/src/decoder/flac_decoder_plugin.c
@@ -286,16 +286,14 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
/* end of this sub track */
break;
- if (!FLAC__stream_decoder_process_single(flac_dec)) {
- cmd = decoder_get_command(decoder);
- if (cmd != DECODE_COMMAND_SEEK)
- break;
+ if (!FLAC__stream_decoder_process_single(flac_dec) &&
+ decoder_get_command(decoder) == DECODE_COMMAND_NONE) {
+ /* a failure that was not triggered by a
+ decoder command */
+ flacPrintErroredState(FLAC__stream_decoder_get_state(flac_dec));
+ break;
}
}
-
- if (cmd != DECODE_COMMAND_STOP) {
- flacPrintErroredState(FLAC__stream_decoder_get_state(flac_dec));
- }
}
static FLAC__StreamDecoderInitStatus