From 7e1051d8ec24615089a88f632e3f865b37283cbe Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 27 Jan 2010 08:41:08 +0000 Subject: Fix seeking in FLAC implementation (FLAC's API uses the number of sample pairs, not the number of samples). svn-id: r47593 --- sound/decoders/flac.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sound/decoders') diff --git a/sound/decoders/flac.cpp b/sound/decoders/flac.cpp index 6fa7302a9a..93233e2cb5 100644 --- a/sound/decoders/flac.cpp +++ b/sound/decoders/flac.cpp @@ -294,7 +294,9 @@ bool FlacInputStream::seekAbsolute(FLAC__uint64 sample) { bool FlacInputStream::seek(const Timestamp &where) { _sampleCache.bufFill = 0; _sampleCache.bufReadPos = NULL; - return seekAbsolute((FLAC__uint64)convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames()); + // FLAC uses the sample pair number, thus we always use "false" for the isStereo parameter + // of the convertTimeToStreamPos helper. + return seekAbsolute((FLAC__uint64)convertTimeToStreamPos(where, getRate(), false).totalNumberOfFrames()); } int FlacInputStream::readBuffer(int16 *buffer, const int numSamples) { -- cgit v1.2.3