[Scummvm-cvs-logs] SF.net SVN: scummvm:[44559] scummvm/branches/branch-1-0-0/engines/sword1/ music.cpp
dhewg at users.sourceforge.net
dhewg at users.sourceforge.net
Sat Oct 3 21:34:26 CEST 2009
Revision: 44559
http://scummvm.svn.sourceforge.net/scummvm/?rev=44559&view=rev
Author: dhewg
Date: 2009-10-03 19:34:26 +0000 (Sat, 03 Oct 2009)
Log Message:
-----------
Backport of r44557: If make*Stream failed, the file needs to be closed to prevent an assert on a consecutive open().
Modified Paths:
--------------
scummvm/branches/branch-1-0-0/engines/sword1/music.cpp
Modified: scummvm/branches/branch-1-0-0/engines/sword1/music.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/sword1/music.cpp 2009-10-03 19:33:54 UTC (rev 44558)
+++ scummvm/branches/branch-1-0-0/engines/sword1/music.cpp 2009-10-03 19:34:26 UTC (rev 44559)
@@ -213,27 +213,40 @@
#ifdef USE_FLAC
if (!_audioSource) {
sprintf(fileName, "%s.flac", fileBase);
- if (_file.open(fileName))
+ if (_file.open(fileName)) {
_audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1);
+ if (!_audioSource)
+ _file.close();
+ }
}
+
if (!_audioSource) {
sprintf(fileName, "%s.fla", fileBase);
- if (_file.open(fileName))
+ if (_file.open(fileName)) {
_audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1);
+ if (!_audioSource)
+ _file.close();
+ }
}
#endif
#ifdef USE_VORBIS
if (!_audioSource) {
sprintf(fileName, "%s.ogg", fileBase);
- if (_file.open(fileName))
+ if (_file.open(fileName)) {
_audioSource = Audio::makeVorbisStream(&_file, false, 0, 0, loop ? 0 : 1);
+ if (!_audioSource)
+ _file.close();
+ }
}
#endif
#ifdef USE_MAD
if (!_audioSource) {
sprintf(fileName, "%s.mp3", fileBase);
- if (_file.open(fileName))
+ if (_file.open(fileName)) {
_audioSource = Audio::makeMP3Stream(&_file, false, 0, 0, loop ? 0 : 1);
+ if (!_audioSource)
+ _file.close();
+ }
}
#endif
if (!_audioSource) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list