mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
libFLAC: Set decoding status if write callback failed
Previously, it the write callback failed the error status would be set to `FLAC__STREAM_DECODER_READ_FRAME`. Now it gets set to `FLAC__STREAM_DECODER_WRITE_STATUS_ABORT`. Patch-from: lvqcl <lvqcl.mail@gmail.com>
This commit is contained in:
@@ -228,7 +228,7 @@ typedef enum {
|
||||
*/
|
||||
|
||||
FLAC__STREAM_DECODER_ABORTED,
|
||||
/**< The decoder was aborted by the read callback. */
|
||||
/**< The decoder was aborted by the read or write callback. */
|
||||
|
||||
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
|
||||
/**< An error occurred allocating memory. The decoder is in an invalid
|
||||
|
||||
@@ -2147,9 +2147,11 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL
|
||||
|
||||
/* write it */
|
||||
if(do_full_decode) {
|
||||
if(write_audio_frame_to_client_(decoder, &decoder->private_->frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE)
|
||||
if(write_audio_frame_to_client_(decoder, &decoder->private_->frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE) {
|
||||
decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user