[Scummvm-cvs-logs] SF.net SVN: scummvm: [23340] scummvm/trunk/backends/gp32/gp32std_sound.cpp

wonst719 at users.sourceforge.net wonst719 at users.sourceforge.net
Thu Jun 29 07:35:00 CEST 2006


Revision: 23340
Author:   wonst719
Date:     2006-06-28 22:34:56 -0700 (Wed, 28 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23340&view=rev

Log Message:
-----------
Lock sound timer thread.

Modified Paths:
--------------
    scummvm/trunk/backends/gp32/gp32std_sound.cpp
Modified: scummvm/trunk/backends/gp32/gp32std_sound.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32std_sound.cpp	2006-06-29 05:25:19 UTC (rev 23339)
+++ scummvm/trunk/backends/gp32/gp32std_sound.cpp	2006-06-29 05:34:56 UTC (rev 23340)
@@ -43,6 +43,14 @@
 // polls the current playing position within the buffer.
 
 static void soundTimer() {
+	static int locked = false;
+
+	if (locked) {
+		return;
+	}
+
+	locked = true;
+
 	unsigned int sampleshiftVal = soundBuf.samples << shiftVal;
 	unsigned int t = (((unsigned int)(*soundPos) - (unsigned int)buffer) >> shiftVal) >= soundBuf.samples ? 1 : 0;
 	if (t != frame) {
@@ -90,6 +98,8 @@
 			} while ((uint32)d < max);
 		}
 	}
+
+	locked = false;
 }
 
 int gp_soundBufStart(GPSOUNDBUF *sb) {


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