changeset 3181:1596dcb77acd trunk

Track playback monitor thread in InputPlayback.thread.
author William Pitcock <nenolod@atheme-project.org>
date Fri, 27 Jul 2007 15:28:26 -0500
parents 959fba26290d
children 06d89ea93859
files src/audacious/playback.c src/audacious/plugin.h
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playback.c	Thu Jul 26 14:59:29 2007 -0500
+++ b/src/audacious/playback.c	Fri Jul 27 15:28:26 2007 -0500
@@ -192,6 +192,9 @@
         if (playback->plugin->stop)
             playback->plugin->stop(playback);
 
+        if (playback->thread != NULL)
+            g_thread_join(playback->thread);
+
         free_vis_data();
         ip_data.paused = FALSE;
 
@@ -242,6 +245,7 @@
     playback->plugin = entry->decoder;
     playback->output = &psuedo_output_plugin;
     playback->filename = g_strdup(entry->filename);
+    playback->thread = g_thread_self();
     
     set_current_input_playback(playback);
 
@@ -252,6 +256,8 @@
     else if (playback->error)
         playback_error();
 
+    playback->thread = NULL;
+    g_thread_exit(NULL);
     return NULL;
 }
 
--- a/src/audacious/plugin.h	Thu Jul 26 14:59:29 2007 -0500
+++ b/src/audacious/plugin.h	Fri Jul 27 15:28:26 2007 -0500
@@ -191,6 +191,8 @@
     int playing;
     gboolean error;
     gboolean eof;
+
+    GThread *thread;
 };
 
 struct _InputPlugin {