From a8f8ceee0f14d2dd2c8e2eaf49a6f627b3353adc Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 12 Feb 2004 17:31:33 +0000 Subject: Removed now obsolete getSamplesPlayed() function. It was only ever used for the Broken Sword cutscenes, where it didn't work very well, and was never fully implemented. svn-id: r12832 --- sound/audiostream.h | 13 ------------- sound/vorbis.cpp | 6 +----- 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'sound') diff --git a/sound/audiostream.h b/sound/audiostream.h index 0dde9a61b5..97822c0c26 100644 --- a/sound/audiostream.h +++ b/sound/audiostream.h @@ -74,19 +74,6 @@ public: /** Sample rate of the stream. */ virtual int getRate() const = 0; - - /** - * This function returns the number of samples that were delivered to - * the mixer which is a rough estimate of how moch time of the stream - * has been played. - * The exact value is not available as it needs information from the - * audio device on how many samples have been already played - * As our buffer is relatively short the estimate is exact enough - * The return -1 is kind of a hack as this function is only required - * for the video audio sync in the bs2 cutscenes I am to lazy to - * implement it for all subclasses - */ - virtual int getSamplesPlayed() const { return -1; } }; class AppendableAudioStream : public AudioStream { diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 3267080502..4c515257af 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -172,7 +172,6 @@ class VorbisInputStream : public AudioStream { int16 _buffer[4096]; const int16 *_bufferEnd; const int16 *_pos; - int _played; void refill(); inline bool eosIntern() const; @@ -185,7 +184,6 @@ public: bool isStereo() const { return _numChannels >= 2; } int getRate() const { return ov_info(_ov_file, -1)->rate; } - int getSamplesPlayed() const { return _played / _numChannels; } }; @@ -196,7 +194,7 @@ public: VorbisInputStream::VorbisInputStream(OggVorbis_File *file, int duration) - : _ov_file(file), _bufferEnd(_buffer + ARRAYSIZE(_buffer)), _played(0) { + : _ov_file(file), _bufferEnd(_buffer + ARRAYSIZE(_buffer)) { // Check the header, determine if this is a stereo stream _numChannels = ov_info(_ov_file, -1)->channels; @@ -218,7 +216,6 @@ inline int16 VorbisInputStream::read() { if (_pos >= _bufferEnd) { refill(); } - _played++; return sample; } @@ -238,7 +235,6 @@ int VorbisInputStream::readBuffer(int16 *buffer, const int numSamples) { refill(); } } - _played += samples; return samples; } -- cgit v1.2.3