[flac-dev] FLAC__stream_decoder_seek_absolute calling write callback

Tamás Zahola tzahola at gmail.com
Wed Jan 13 01:33:42 PST 2016


Hello,

The API documentation [1] `FLAC__stream_decoder_seek_absolute` says:

"Flush the input and seek to an absolute sample. Decoding will resume
at the given sample. Note that because of this, the next write
callback may contain a partial block."

I expected that subsequent `process_single` calls would return data
starting exactly from the sample I've seeked to. To my surprise
hovewer it seems that `seek_absolute` implicitly processes the frame
which contains the requested sample (the write callback receives only
the tail of the frame from the given sample).

Since the documentation haven't mentioned seek_absolute triggering the
write callback, my question would be whether this behaviour is
guaranteed or not? Is seek_absolute guaranteed to implicitly process
the frame containing the requested sample? (in other worfs: a
process_single call after a successful seek_absolute call always
processes the frame _after_ the one contaning the requested sample)

Best regards,
Tamas Zahola <tzahola at gmail.com>

[1] https://xiph.org/flac/api/group__flac__stream__decoder.html#ga6a2eb6072b9fafefc3f80f1959805ccb


More information about the flac-dev mailing list