[flac-dev] [PATCH] set decoding status if write callback failed.

lvqcl lvqcl.mail at gmail.com
Sun Jul 10 08:41:53 UTC 2016


Open src/flac/decode.c, find write_callback() function and add

     return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;

to the beginning of the function. Decoding will fail with
the following message:

test.flac: ERROR while decoding data
              state = FLAC__STREAM_DECODER_READ_FRAME

As you can see, decoder state isn't quite correct.

One of the ways to fix this is in the attached patch.
After the patch flac writes:

test.flac: ERROR while decoding data
              state = FLAC__STREAM_DECODER_ABORTED

which is more logical.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set_decoding_status.patch
Type: application/octet-stream
Size: 1333 bytes
Desc: not available
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20160710/ce29070d/attachment.obj>


More information about the flac-dev mailing list