decoder/flac: try to recover from seek error()

libFLAC API documentation suggests that FLAC__stream_decoder_flush()
should be called to recover from FLAC__STREAM_DECODER_SEEK_ERROR.
This commit is contained in:
Max Kellermann 2016-07-05 19:29:22 +02:00
parent faf2eeaa99
commit f9130f42a2

View File

@ -209,8 +209,16 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
/* regular end of stream */
return;
case FLAC__STREAM_DECODER_OGG_ERROR:
case FLAC__STREAM_DECODER_SEEK_ERROR:
/* try to recover from seek error */
if (!FLAC__stream_decoder_flush(flac_dec)) {
LogError(flac_domain, "FLAC__stream_decoder_flush() failed");
return;
}
break;
case FLAC__STREAM_DECODER_OGG_ERROR:
case FLAC__STREAM_DECODER_ABORTED:
case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
/* an error, fatal enough for us to abort the