If the flac read callback is called with too little data available
in the input queue to decode a single frame, we abort the decoder
and call FLAC__stream_decoder_flush() afterwards. This discards the
partially submitted frame so we must feed these data again when more
input is available.
However, we currently miss to do so, resulting in all sorts of
flac errors. This patch sets ->unconsumed to zero which fixes the bug.
goto out;
if (state == FLAC__STREAM_DECODER_ABORTED) {
FLAC__stream_decoder_flush(pfd->decoder);
- fn->min_iqs = pfd->unconsumed + 1;
+ pfd->unconsumed = 0; /* feed unconsumed bytes again */
+ fn->min_iqs = btr_get_input_queue_size(btrn) + 1;
ret = 1;
goto out;
}
+ pfd->have_more = true;
fn->min_iqs = 0;
ret = 1;
out: