changeset 1158:c01fe6970660 trunk

[svn] - remove an old hack that is no longer necessary (can cause a crash (!))
author nenolod
date Thu, 08 Jun 2006 12:11:06 -0700
parents e4eac9fa1614
children a268c19f8fad
files Plugins/Input/aac/src/libmp4.c
diffstat 1 files changed, 1 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/aac/src/libmp4.c	Thu Jun 08 11:34:43 2006 -0700
+++ b/Plugins/Input/aac/src/libmp4.c	Thu Jun 08 12:11:06 2006 -0700
@@ -78,7 +78,6 @@
 
 void     audmp4_file_info_box(gchar *);
 gboolean buffer_playing;
-gint	 doExit;
 
 InputPlugin mp4_ip =
   {
@@ -173,7 +172,6 @@
 static void mp4_play(char *filename)
 {
   buffer_playing = TRUE;
-  doExit = 0;
   decodeThread = g_thread_create((GThreadFunc)mp4Decode, g_strdup(filename), TRUE, NULL);
   return;
 }
@@ -183,18 +181,8 @@
   if(buffer_playing){
     buffer_playing = FALSE;
     mp4_ip.output->close_audio();
+    g_thread_join(decodeThread);
   }
-
-  /*
-   * The problem is, we can't just go try to reap the thread, it probably
-   * won't work. This hint gives us points where the thread can just quit.
-   * Which basically serves the same function...
-   *
-   *       - nenolod
-   */
-  g_static_mutex_lock(&mutex);
-  doExit = 1;
-  g_static_mutex_unlock(&mutex);
 }
 
 static int	mp4_IsOurFile(char *filename)
@@ -433,21 +421,9 @@
 				/* Finish playing before we close the
 				   output. */
 				while ( mp4_ip.output->buffer_playing() ) {
-					if (doExit)
-					{
-						doExit = 0;
-						g_thread_exit(NULL);
-					}
-
 					xmms_usleep(10000);
 				}
 
-				if (doExit)
-				{
-					doExit = 0;
-					g_thread_exit(NULL);
-				}
-
 				mp4_ip.output->flush(seekPosition*1000);
 				mp4_ip.output->close_audio();
 				faacDecClose(decoder);
@@ -477,12 +453,6 @@
 				return FALSE;
 			}
 
-			if (doExit)
-			{
-				doExit = 0;
-				g_thread_exit(NULL);
-			}
-
 			sampleBuffer= faacDecDecode(decoder, 
 						    &frameInfo, 
 						    buffer,