aboutsummaryrefslogtreecommitdiff
path: root/sound/flac.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-06 16:11:21 +0000
committerJohannes Schickel2010-01-06 16:11:21 +0000
commit8c79b6f6ee2cb11e1352df5fa4faf70903eca364 (patch)
tree88477b6483124eed9637f9f321d91009057119d5 /sound/flac.cpp
parentc58c870159fb1b337fd10d154381222eb5557294 (diff)
downloadscummvm-rg350-8c79b6f6ee2cb11e1352df5fa4faf70903eca364.tar.gz
scummvm-rg350-8c79b6f6ee2cb11e1352df5fa4faf70903eca364.tar.bz2
scummvm-rg350-8c79b6f6ee2cb11e1352df5fa4faf70903eca364.zip
Adapt FLAC and Vorbis to use calculateSampleOffset in their seek implementation.
svn-id: r47085
Diffstat (limited to 'sound/flac.cpp')
-rw-r--r--sound/flac.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/flac.cpp b/sound/flac.cpp
index 28db39f9f3..b592468baf 100644
--- a/sound/flac.cpp
+++ b/sound/flac.cpp
@@ -335,9 +335,7 @@ bool FlacInputStream::seekAbsolute(FLAC__uint64 sample) {
bool FlacInputStream::seek(const Timestamp &where) {
_sampleCache.bufFill = 0;
_sampleCache.bufReadPos = NULL;
- // Compute the start/end sample (we use floating point arithmetics here to
- // avoid overflows).
- return seekAbsolute((FLAC__uint64)(where.msecs() * (_streaminfo.sample_rate / 1000.0)));
+ return seekAbsolute((FLAC__uint64)calculateSampleOffset(where, _streaminfo.sample_rate));
}
int FlacInputStream::readBuffer(int16 *buffer, const int numSamples) {