From: Josh Coalson Date: Fri, 6 Oct 2006 06:22:48 +0000 (+0000) Subject: more robust -F: if end-of-stream is hit due to partial frame, decoding will complete... X-Git-Tag: 1.2.0~391 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34ae241cade680eccc50776af4fa207ad5d2368c;p=platform%2Fupstream%2Fflac.git more robust -F: if end-of-stream is hit due to partial frame, decoding will complete and leave the output --- diff --git a/src/flac/decode.c b/src/flac/decode.c index 49d149a..4a904ea 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -499,7 +499,8 @@ FLAC__bool DecoderSession_process(DecoderSession *d) if(!OggFLAC__stream_decoder_process_until_end_of_stream(d->decoder.ogg) && !d->aborting_due_to_until) { flac__utils_printf(stderr, 2, "\n"); print_error_with_state(d, "ERROR while decoding data"); - return false; + if(!d->continue_through_decode_errors) + return false; } if(OggFLAC__stream_decoder_get_state(d->decoder.ogg) != OggFLAC__STREAM_DECODER_OK && OggFLAC__stream_decoder_get_state(d->decoder.ogg) != OggFLAC__STREAM_DECODER_END_OF_STREAM && !d->aborting_due_to_until) { flac__utils_printf(stderr, 2, "\n"); @@ -513,7 +514,8 @@ FLAC__bool DecoderSession_process(DecoderSession *d) if(!FLAC__stream_decoder_process_until_end_of_stream(d->decoder.flac) && !d->aborting_due_to_until) { flac__utils_printf(stderr, 2, "\n"); print_error_with_state(d, "ERROR while decoding data"); - return false; + if(!d->continue_through_decode_errors) + return false; } if(FLAC__stream_decoder_get_state(d->decoder.flac) > FLAC__STREAM_DECODER_END_OF_STREAM && !d->aborting_due_to_until) { flac__utils_printf(stderr, 2, "\n");