diff options
author | Johannes Schickel | 2010-01-27 08:41:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-27 08:41:08 +0000 |
commit | 7e1051d8ec24615089a88f632e3f865b37283cbe (patch) | |
tree | 2f800a86bb84f6179c59460799f4a7bfb442f8d4 /sound | |
parent | 8606982590bb3c124cc4d17fbe15aa722803201e (diff) | |
download | scummvm-rg350-7e1051d8ec24615089a88f632e3f865b37283cbe.tar.gz scummvm-rg350-7e1051d8ec24615089a88f632e3f865b37283cbe.tar.bz2 scummvm-rg350-7e1051d8ec24615089a88f632e3f865b37283cbe.zip |
Fix seeking in FLAC implementation (FLAC's API uses the number of sample pairs, not the number of samples).
svn-id: r47593
Diffstat (limited to 'sound')
-rw-r--r-- | sound/decoders/flac.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |