From 0417c0ab888fcf674ea1a1138ce7a555a67c796d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 28 Jan 2010 09:44:21 +0000 Subject: [PATCH] Fix seek implementation of our Vorbis stream. svn-id: r47635 --- sound/decoders/vorbis.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/decoders/vorbis.cpp b/sound/decoders/vorbis.cpp index f5ebc112c36..5899eaa1fd9 100644 --- a/sound/decoders/vorbis.cpp +++ b/sound/decoders/vorbis.cpp @@ -169,7 +169,9 @@ int VorbisInputStream::readBuffer(int16 *buffer, const int numSamples) { } bool VorbisInputStream::seek(const Timestamp &where) { - int res = ov_pcm_seek(&_ovFile, convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames()); + // Vorbisfile uses the sample pair number, thus we always use "false" for the isStereo parameter + // of the convertTimeToStreamPos helper. + int res = ov_pcm_seek(&_ovFile, convertTimeToStreamPos(where, getRate(), false).totalNumberOfFrames()); if (res) { warning("Error seeking in Vorbis stream (%d)", res); _pos = _bufferEnd;