# HG changeset patch # User William Pitcock # Date 1185230295 18000 # Node ID 76f826e6052d9d3e4551cf96aa1b3356eaf86033 # Parent d3fb6dfcd2f8a3fdcfd26078b82d14f09120f9db aac: Convert to new threading model. diff -r d3fb6dfcd2f8 -r 76f826e6052d src/aac/src/libmp4.c --- a/src/aac/src/libmp4.c Mon Jul 23 17:27:44 2007 -0500 +++ b/src/aac/src/libmp4.c Mon Jul 23 17:38:15 2007 -0500 @@ -125,7 +125,8 @@ { buffer_playing = TRUE; playback->playing = 1; //XXX should acquire lock? - decodeThread = g_thread_create((GThreadFunc)mp4_decode, playback, TRUE, NULL); + mp4_decode(playback); + decodeThread = g_thread_self(); } static void mp4_stop(InputPlayback *playback) @@ -593,8 +594,6 @@ buffer_playing = FALSE; playback->playing = 0; g_static_mutex_unlock(&mutex); - g_thread_exit(NULL); - return FALSE; } rc= mp4ff_read_sample(mp4file, mp4track, @@ -675,7 +674,7 @@ buffer_playing = FALSE; playback->playing = 0; g_static_mutex_unlock(&mutex); - g_thread_exit(NULL); + return; } if((buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file))==0){ g_print("AAC: Error reading file\n"); @@ -684,7 +683,7 @@ playback->playing = 0; faacDecClose(decoder); g_static_mutex_unlock(&mutex); - g_thread_exit(NULL); + return; } if(!strncmp((char*)streambuffer, "ID3", 3)){ gint size = 0; @@ -733,7 +732,7 @@ buffer_playing = FALSE; playback->playing = 0; g_static_mutex_unlock(&mutex); - g_thread_exit(NULL); + return; } mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels); @@ -827,7 +826,6 @@ buffer_playing = FALSE; playback->playing = 0; g_static_mutex_unlock(&mutex); - g_thread_exit(NULL); } static void *mp4_decode( void *args ) @@ -848,7 +846,7 @@ g_static_mutex_unlock(&mutex); if (mp4fh == NULL) - g_thread_exit(NULL); + return NULL; ret = parse_aac_stream(mp4fh);