Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // invoked from SDL audio thread to fill buffer with more samples
- size_t Flac::getData(size_t len, void *buf)
- {
- bool success = true;
- while (success && !enoughSamples() && moreDataAvailable())
- success = decoder->process_single()
- // Now copy data from Flac buffers to buf, keeping any overflow for
- // next time. If we got less than requested, return the truncated
- // count.
- }
- ::FLAC__StreamDecoderWriteStatus FlacDecoder::write_callback(const ::FLAC__Frame *frame, const FLAC__int32 *const buffer[])
- {
- // copy the decoded data into our Flac buffer for its SDL callback
- // to fetch and update the count and moreDataAvailable flag
- return ::FLAC__StreamDecoderWriteStatus();
- }
- // cache the Flac object here for use by the callback
- FlacDecoder(TagLib::String path, Flac& flac_) : FLAC::Decoder::File(), flac(flac_), m_path(path) { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement