decoder/flac: check for errors only after _process_single()

The only other libFLAC call (seek) does not produce fatal errors.
This commit is contained in:
Max Kellermann 2012-02-11 12:47:43 +01:00
parent 851fb16e7c
commit d95db28695

View File

@ -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