Tamás Zahola
2016-Jan-19 21:15 UTC
[flac-dev] FLAC__stream_decoder_seek_absolute calling write callback
> Hi, > Sorry for the tardy response to this. I've now read your email a number of > times and I'm still not sure what needs to be done. > Maybe it would help if you could explain the following: > * What is actually happening. > * What you expect to happen and how that differs from what is happening. > * Propose a fix. > Once thing that may actually help is a small chunk of code demonstrating > the problem.Thanks for your response! Here's an example: #include <iostream> #include <FLAC++/all.h> int main(int argc, const char * argv[]) { class Decoder : public FLAC::Decoder::File { protected: virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) override { std::cout << "write_callback called!" << std::endl; abort(); return FLAC__StreamDecoderWriteStatus::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) override {} } decoder; decoder.init("sample.flac"); decoder.process_until_end_of_metadata(); decoder.seek_absolute(1); return 0; } Despite not calling `process_single`, this snippet crashes with "write_callback called!" because internally `seek_absolute(sample)` processes the frame which contains `sample`. My question was whether this behaviour was intentional/documented (I haven't found it being mentioned in the docs) and whether if it happens always (or e.g. only if I specify a sample that's not on a frame boundary, etc.)? Best regards, Tamas Zahola
Possibly Parallel Threads
- FLAC__stream_decoder_seek_absolute calling write callback
- FLAC++ SeekableStream write_callback not being called?
- FLAC++ SeekableStream write_callback not being called?
- http streaming in the xmms plugin
- 16 bits FLAC file data to 32 bit float buffer for CPU processing