Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37841134
en ru br
ALT Linux repos
S:2.00-alt2_37

Group :: Games/Other
RPM: nogravity

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: nogravity-2.00-rhbz699274.patch
Download


diff -up nogravity-2.00/src/lt_sound.c~ nogravity-2.00/src/lt_sound.c
--- nogravity-2.00/src/lt_sound.c~	2011-12-06 15:58:45.000000000 +0100
+++ nogravity-2.00/src/lt_sound.c	2011-12-06 16:12:07.828431143 +0100
@@ -261,11 +261,13 @@ static u_int32_t CALLING_STD Thread(void
 {
 	UNUSED(context);
 	
-	while (m_Status)
+	while (1)
 	{	
 #ifdef USE_MUTEX
 		mutex_lock(&m_Mutex);
 #endif
+		if (!m_Status)
+			break;
 		V3XAStream_Poll(g_pWavStream);
 #ifdef USE_MUTEX
 		mutex_unlock(&m_Mutex);		
@@ -304,10 +306,10 @@ void NG_AudioPlayTrack(int i)
 	m_Thread.pArgument = NULL;
 	m_Thread.pFunc = Thread;
 	m_Status = 1;
-	thread_begin(&m_Thread, SYS_THREAD_PRIORITY_NORMAL);
 #ifdef USE_MUTEX
 	mutex_init(&m_Mutex);	
 #endif
+	thread_begin(&m_Thread, SYS_THREAD_PRIORITY_NORMAL);
 #endif
 
     return;
@@ -510,6 +512,10 @@ void NG_AudioStopMusic(void)
 
 	if (g_pWavStream)
 	{
+#ifdef USE_MUTEX
+		m_Status = 0;
+		mutex_lock(&m_Mutex);
+#endif
 		for(i=g_SGSettings.VolMusic;i!=0;i--)
 		{
 			V3XAStream_SetVolume(g_pWavStream, 0, (float)i/100);
@@ -518,10 +524,6 @@ void NG_AudioStopMusic(void)
 			timer_snooze((64L*12L)/((g_SGSettings.VolMusic*4)+1));
 		}
 		
-#ifdef USE_MUTEX		
-		mutex_lock(&m_Mutex);
-		m_Status = 0;
-#endif
 		V3XAStream_Release(g_pWavStream);
 		
 #ifdef USE_MUTEX
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin