[Scummvm-cvs-logs] CVS: scummvm/sound vorbis.cpp,1.11,1.11.2.1

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sun Jul 18 09:52:03 CEST 2004


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19583

Modified Files:
      Tag: branch-0-6-0
	vorbis.cpp 
Log Message:
Backported fix for when several Ogg Vorbis sounds are streamed at the same
time. I don't remember if there ever was any bug report on it, but it has
been known to happen in FotAQ and in the Sam & Max intro.


Index: vorbis.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/vorbis.cpp,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- vorbis.cpp	12 Feb 2004 17:31:33 -0000	1.11
+++ vorbis.cpp	18 Jul 2004 16:51:21 -0000	1.11.2.1
@@ -71,6 +71,9 @@
 		nmemb = 0;
 	else if (nmemb > f->len - f->curr_pos)
 		nmemb = f->len - f->curr_pos;
+	// There is no guarantee that the Vorbis stream is alone in accessing
+	// the file, so make sure the current position is what we think it is.
+	f->file->seek(f->start + f->curr_pos);
 	result = f->file->read(ptr, nmemb);
 	if (result == -1) {
 		f->curr_pos = f->file->pos() - f->start;





More information about the Scummvm-git-logs mailing list