changeset 1031:c9e641ff4a28 trunk

[svn] - threading cleanups, we no longer need to be mutexlocked 90% of the time, and we shouldn't have been joining in stop(), as the thread will likely already be joined, and if not, it will be reaped later
author nenolod
date Fri, 12 May 2006 14:03:50 -0700
parents 2ed9643e968b
children aa0559a5fee1
files Plugins/Input/aac/src/libmp4.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/aac/src/libmp4.c	Fri May 12 13:47:25 2006 -0700
+++ b/Plugins/Input/aac/src/libmp4.c	Fri May 12 14:03:50 2006 -0700
@@ -180,7 +180,6 @@
 {
   if(buffer_playing){
     buffer_playing = FALSE;
-    g_thread_join(decodeThread);
     mp4_ip.output->close_audio();
   }
 }
@@ -428,7 +427,10 @@
 				mp4_ip.output->close_audio();
 				faacDecClose(decoder);
 
+				g_static_mutex_lock(&mutex);
 				buffer_playing = FALSE;
+				g_static_mutex_unlock(&mutex);
+				g_thread_exit(NULL);
 
 				return FALSE;
 			}
@@ -666,6 +668,7 @@
 	g_static_mutex_lock(&mutex);
 	seekPosition= -1;
 	buffer_playing= TRUE;
+	g_static_mutex_unlock(&mutex);
 
 	mp4file= mp4ff_open_read(mp4cb);
 	if( !mp4file ) {
@@ -682,6 +685,7 @@
 
 		g_free(args);
 		vfs_fclose(mp4fh);
+		g_static_mutex_lock(&mutex);
 		buffer_playing = FALSE;
 		g_static_mutex_unlock(&mutex);
 		g_thread_exit(NULL);