# HG changeset patch # User nenolod # Date 1131669609 28800 # Node ID 32c320bba8a6a4595cb9239fc9422646ce40d545 # Parent 5ce1d36e9ff50d4aebf0ffbd3aae6925db1374e5 [svn] Mutex system diff -r 5ce1d36e9ff5 -r 32c320bba8a6 audacious/input.h --- a/audacious/input.h Thu Nov 10 15:56:32 2005 -0800 +++ b/audacious/input.h Thu Nov 10 16:40:09 2005 -0800 @@ -31,6 +31,7 @@ InputPlugin *current_input_plugin; gboolean playing; gboolean paused; + GMutex *playback_mutex; }; GList *get_input_list(void); diff -r 5ce1d36e9ff5 -r 32c320bba8a6 audacious/playback.c --- a/audacious/playback.c Thu Nov 10 15:56:32 2005 -0800 +++ b/audacious/playback.c Thu Nov 10 16:40:09 2005 -0800 @@ -91,6 +91,10 @@ if (bmp_playback_get_playing()) bmp_playback_stop(); + ip_data.playback_mutex = g_mutex_new(); + + g_mutex_lock(ip_data.playback_mutex); + vis_clear_data(mainwin_vis); vis_clear_data(playlistwin_vis); svis_clear_data(mainwin_svis); @@ -114,6 +118,8 @@ playlist_check_pos_current(); mainwin_set_info_text(); + + g_mutex_unlock(ip_data.playback_mutex); } void @@ -138,6 +144,8 @@ void bmp_playback_stop(void) { + g_mutex_lock(ip_data.playback_mutex); + if (ip_data.playing && get_current_input_plugin()) { ip_data.playing = FALSE; @@ -158,6 +166,9 @@ } ip_data.playing = FALSE; + + g_mutex_unlock(ip_data.playback_mutex); + g_mutex_free(ip_data.playback_mutex); }