From d95db286953d9a678b88c3539bec382a57082ee4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 11 Feb 2012 12:47:43 +0100 Subject: decoder/flac: check for errors only after _process_single() The only other libFLAC call (seek) does not produce fatal errors. --- src/decoder/flac_decoder_plugin.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/decoder/flac_decoder_plugin.c b/src/decoder/flac_decoder_plugin.c index e8e93ff37..9dc1898d5 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 -- cgit v1.2.3