From ff573ec1e214c233a530a96798c0b33738bd8467 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 24 May 2008 23:58:22 +0000 Subject: Instead of simply returning 0 for "infinite" looping in FLAC and OGG/Vorbis streams in getTotalPlayTime return kUnknownPlayTime. svn-id: r32265 --- sound/flac.cpp | 3 +++ sound/vorbis.cpp | 3 +++ 2 files changed, 6 insertions(+) (limited to 'sound') diff --git a/sound/flac.cpp b/sound/flac.cpp index 7b424c1d76..acd0a9fef7 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -143,6 +143,9 @@ public: } int32 getTotalPlayTime() const { + if (!_totalNumLoops) + return AudioStream::kUnknownPlayTime; + int32 samples = 0; if (!_lastSample) { diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 8c12acc6e9..64f67d2a13 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -120,6 +120,9 @@ public: int getRate() const { return _rate; } int32 getTotalPlayTime() const { + if (!_totalNumLoops) + return AudioStream::kUnknownPlayTime; + #ifdef USE_TREMOR return (_endTime - _startTime) * _totalNumLoops; #else -- cgit v1.2.3