aboutsummaryrefslogtreecommitdiff
path: root/sound/vorbis.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/vorbis.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/vorbis.cpp')
-rw-r--r--sound/vorbis.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index 2fd7c978be..1ed608c0b5 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -240,14 +240,8 @@ int VorbisInputStream::readBuffer(int16 *buffer, const int numSamples) {
}
bool VorbisInputStream::seek(const Timestamp &where) {
-#ifdef USE_TREMOR
- ogg_int64_t pos = where.msecs();
-#else
- double pos = where.msecs() / 1000.0;
-#endif
-
- int res = ov_time_seek(&_ovFile, pos);
- if (res < 0) {
+ int res = ov_pcm_seek(&_ovFile, calculateSampleOffset(where, getRate()));
+ if (res) {
warning("Error seeking in Vorbis stream (%d)", res);
_pos = _bufferEnd;
return false;