[][src]Function flac_sys::FLAC__stream_decoder_reset

pub unsafe extern "C" fn FLAC__stream_decoder_reset(
    decoder: *mut FLAC__StreamDecoder
) -> FLAC__bool

Reset the decoding process. The decoder's input buffer will be cleared and the state set to \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA. This is similar to FLAC__stream_decoder_finish() except that the settings are preserved; there is no need to call FLAC__stream_decoder_init_*() before decoding again. MD5 checking will be restored to its original setting.

If the decoder is seekable, or was initialized with FLAC__stream_decoder_init*_FILE() or FLAC__stream_decoder_init*_file(), the decoder will also attempt to seek to the beginning of the file. If this rewind fails, this function will return \c false. It follows that FLAC__stream_decoder_reset() cannot be used when decoding from \c stdin.

If the decoder was initialized with FLAC__stream_encoder_init*_stream() and is not seekable (i.e. no seek callback was provided or the seek callback returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED), it is the duty of the client to start feeding data from the beginning of the stream on the next FLAC__stream_decoder_process() or FLAC__stream_decoder_process_interleaved() call.

\param decoder A decoder instance. \assert \code decoder != NULL \endcode \retval FLAC__bool \c true if successful, else \c false if a memory allocation occurs (in which case the state will be set to \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR) or a seek error occurs (the state will be unchanged).