aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-02-26 01:14:47 +0200
committerEugene Sandulenko2015-12-15 00:05:02 +0100
commit4cf271054ab215d78f746c0596f86ef7c72f81c0 (patch)
tree6352a89976d42e80ae7a4082432d569660b3930f /engines
parent219811feaa9fcf23266d97423d013244280cf9f3 (diff)
downloadscummvm-rg350-4cf271054ab215d78f746c0596f86ef7c72f81c0.tar.gz
scummvm-rg350-4cf271054ab215d78f746c0596f86ef7c72f81c0.tar.bz2
scummvm-rg350-4cf271054ab215d78f746c0596f86ef7c72f81c0.zip
LAB: Bugfix for freeMusic()
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/labmusic.cpp31
1 files changed, 5 insertions, 26 deletions
diff --git a/engines/lab/labmusic.cpp b/engines/lab/labmusic.cpp
index 9bc0ee0dee..5222cd9af6 100644
--- a/engines/lab/labmusic.cpp
+++ b/engines/lab/labmusic.cpp
@@ -117,7 +117,7 @@ void Music::playSoundEffect(uint16 SampleSpeed, uint32 Length, void *Data) {
Audio::SeekableAudioStream *audioStream = Audio::makeRawStream((const byte *)Data, Length, SampleSpeed, soundFlags, DisposeAfterUse::NO);
uint loops = (_loopSoundEffect) ? 0 : 1;
- Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, loops, DisposeAfterUse::YES);
+ Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, loops);
g_lab->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, loopingAudioStream);
}
@@ -143,7 +143,6 @@ void Music::fillbuffer(byte *musicBuffer) {
}
}
-
/*****************************************************************************/
/* Fills up the buffers that have already been played if necessary; if doit */
/* is set to TRUE then it will fill up all empty buffers. Otherwise, it */
@@ -153,7 +152,6 @@ void Music::fillUpMusic(bool doit) {
updateMusic();
}
-
/*****************************************************************************/
/* Starts up the music initially. */
/*****************************************************************************/
@@ -172,7 +170,6 @@ void Music::startMusic(bool startatbegin) {
updateMusic();
}
-
/*****************************************************************************/
/* Initializes the music buffers. */
/*****************************************************************************/
@@ -198,27 +195,21 @@ bool Music::initMusic() {
return false;
}
-
-
/*****************************************************************************/
/* Frees up the music buffers and closes the file. */
/*****************************************************************************/
void Music::freeMusic() {
_musicOn = false;
- if (_file->isOpen())
- _file->close();
-
- _file = 0;
-
g_lab->_mixer->stopHandle(_musicHandle);
+ _queuingAudioStream = NULL;
+
g_lab->_mixer->stopHandle(_sfxHandle);
- delete _queuingAudioStream;
- _queuingAudioStream = NULL;
+ delete _file;
+ _file = NULL;
}
-
/*****************************************************************************/
/* Pauses the background music. */
/*****************************************************************************/
@@ -234,8 +225,6 @@ void Music::pauseBackMusic() {
}
}
-
-
/*****************************************************************************/
/* Resumes the paused background music. */
/*****************************************************************************/
@@ -251,7 +240,6 @@ void Music::resumeBackMusic() {
}
}
-
/*****************************************************************************/
/* Checks to see if need to fill buffers fill of music. */
/*****************************************************************************/
@@ -264,8 +252,6 @@ void Music::checkMusic() {
fillUpMusic(false);
}
-
-
/*****************************************************************************/
/* Checks to see if need to fill buffers fill of music. */
/*****************************************************************************/
@@ -273,10 +259,6 @@ void Music::newCheckMusic() {
checkMusic();
}
-
-
-
-
/*****************************************************************************/
/* Turns the music on and off. */
/*****************************************************************************/
@@ -319,8 +301,6 @@ void Music::changeMusic(const char *newmusic) {
}
}
-
-
/*****************************************************************************/
/* Changes the background music to the original piece playing. */
/*****************************************************************************/
@@ -351,7 +331,6 @@ void Music::resetMusic() {
_tFile = 0;
}
-
/*****************************************************************************/
/* Checks whether or note enough memory in music buffer before loading any */
/* files. Fills it if not. Does not take into account the current buffer */