diff options
author | Torbjörn Andersson | 2003-12-14 16:32:21 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-12-14 16:32:21 +0000 |
commit | ce04dd9f7e77fe1c31eb14aebde2f69c16d33684 (patch) | |
tree | 7cc21471022bd0ef6ca18bde39e29725e00c915c | |
parent | 7400910907609b412d74ed194569098c5f039948 (diff) | |
download | scummvm-rg350-ce04dd9f7e77fe1c31eb14aebde2f69c16d33684.tar.gz scummvm-rg350-ce04dd9f7e77fe1c31eb14aebde2f69c16d33684.tar.bz2 scummvm-rg350-ce04dd9f7e77fe1c31eb14aebde2f69c16d33684.zip |
Fixed a potential crash bug where an audio buffer would be freed at the end
of an animated cutscene while the mixer was still using it. Oddly enough, I
didn't encounter this bug when I played through the game recently, but
today it happened every time at the end of the cutscene where Nico finds
the jaguar stone.
svn-id: r11637
-rw-r--r-- | sword2/driver/d_draw.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp index dab3f9ce5b..82fa3a2415 100644 --- a/sword2/driver/d_draw.cpp +++ b/sword2/driver/d_draw.cpp @@ -215,6 +215,15 @@ int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOu _vm->_system->delay_msecs(90); } + // Wait for the voice to stop playing. This is to make sure + // that we don't cut off the speech in mid-sentence, and - even + // more importantly - that we don't free the sound buffer while + // it's in use. + + while (handle) { + _vm->_system->delay_msecs(100); + }; + closeTextObject(text[textCounter]); _vm->_graphics->clearScene(); |