aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-01 22:55:38 +0000
committerJohannes Schickel2010-01-01 22:55:38 +0000
commit6109275750a3b9df41649a5787923e0578109f8b (patch)
treedbfbf06f3cb7495c9b831bf5164ce627bf76b61f /sound
parent8817d6eeb5990a3eae1ce93b7ea1e6605a0868e0 (diff)
downloadscummvm-rg350-6109275750a3b9df41649a5787923e0578109f8b.tar.gz
scummvm-rg350-6109275750a3b9df41649a5787923e0578109f8b.tar.bz2
scummvm-rg350-6109275750a3b9df41649a5787923e0578109f8b.zip
Properly reset _numPlayedLoops in setNumLoops in all AudioStream implementations implementing setNumLoops.
svn-id: r46861
Diffstat (limited to 'sound')
-rw-r--r--sound/audiostream.cpp5
-rw-r--r--sound/flac.cpp5
-rw-r--r--sound/mp3.cpp5
-rw-r--r--sound/vorbis.cpp5
4 files changed, 16 insertions, 4 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index e8e90de4fa..e1847a4aac 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -224,7 +224,10 @@ class LinearDiskStream : public AudioStream {
static const int32 BUFFER_SIZE = 16384;
#endif
- void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; }
+ void setNumLoops(uint numLoops) {
+ _numLoops = numLoops;
+ _numPlayedLoops = 0;
+ }
uint getNumPlayedLoops() { return _numPlayedLoops; }
protected:
diff --git a/sound/flac.cpp b/sound/flac.cpp
index 09c7cce7c0..d06402e192 100644
--- a/sound/flac.cpp
+++ b/sound/flac.cpp
@@ -151,7 +151,10 @@ public:
bool isStreamDecoderReady() const { return getStreamDecoderState() == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ; }
- void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; }
+ void setNumLoops(uint numLoops = 1) {
+ _numLoops = numLoops;
+ _numPlayedLoops = 0;
+ }
uint getNumPlayedLoops() { return _numPlayedLoops; }
protected:
diff --git a/sound/mp3.cpp b/sound/mp3.cpp
index 6614dc944c..4ed68a3586 100644
--- a/sound/mp3.cpp
+++ b/sound/mp3.cpp
@@ -98,7 +98,10 @@ public:
return _totalPlayTime * _numLoops;
}
- void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; }
+ void setNumLoops(uint numLoops) {
+ _numLoops = numLoops;
+ _numPlayedLoops = 0;
+ }
uint getNumPlayedLoops() { return _numPlayedLoops; }
protected:
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index c80bc700fb..8e0cda06c9 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -121,7 +121,10 @@ public:
bool isStereo() const { return _isStereo; }
int getRate() const { return _rate; }
- void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; }
+ void setNumLoops(uint numLoops) {
+ _numLoops = numLoops;
+ _numPlayedLoops = 0;
+ }
uint getNumPlayedLoops() { return _numPlayedLoops; }
int32 getTotalPlayTime() const {