diff options
author | Laszlo Papp <lpapp@kde.org> | 2011-12-07 19:01:37 +0200 |
---|---|---|
committer | Laszlo Papp <ext-laszlo.papp@nokia.com> | 2011-12-07 19:01:37 +0200 |
commit | a6ded3a69f9341c2717df9fa0f511741e660c058 (patch) | |
tree | 920bba3040edd5f7dbd1b5bb699d3950bbd37089 | |
parent | 3b2a6b7496300f6a6706b49a55dd75d1c8d06cac (diff) |
Implement the tell callback properly and add the missing Q_UNUSED to the seek
-rw-r--r-- | src/decoders/qalflacaudiodecoder.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/decoders/qalflacaudiodecoder.cpp b/src/decoders/qalflacaudiodecoder.cpp index 3babe56..19d0645 100644 --- a/src/decoders/qalflacaudiodecoder.cpp +++ b/src/decoders/qalflacaudiodecoder.cpp @@ -62,6 +62,8 @@ QALFlacAudioDecoder::Private::readCallback(const FLAC__StreamDecoder *decoder, F FLAC__StreamDecoderSeekStatus QALFlacAudioDecoder::Private::seekCallback(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) { + Q_UNUSED(decoder) + if (reinterpret_cast<QALFlacAudioDecoder::Private*>(client_data)->file.seek(absolute_byte_offset) == false) { qWarning() << Q_FUNC_INFO << "Failed to seek in the file"; return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; @@ -70,10 +72,14 @@ QALFlacAudioDecoder::Private::seekCallback(const FLAC__StreamDecoder *decoder, F return FLAC__STREAM_DECODER_SEEK_STATUS_OK; } -sf_count_t -QALFlacAudioDecoder::Private::tellCallback(void *user_data) +FLAC__StreamDecoderTellStatus +QALFlacAudioDecoder::Private::tellCallback(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) { - return reinterpret_cast<QALFlacAudioDecoder::Private*>(user_data)->file.pos(); + Q_UNUSED(decoder) + + *absolute_path_offset = reinterpret_cast<QALFlacAudioDecoder::Private*>(client_data)->file.pos(); + + return FLAC__STREAM_DECODER_TELL_STATUS_OK; } FLAC__StreamDecoderLengthStatus |