comparison audacious/playback.c @ 143:32c320bba8a6 trunk

[svn] Mutex system
author nenolod
date Thu, 10 Nov 2005 16:40:09 -0800
parents cb178e5ad177
children 0faf2fa7fc85
comparison
equal deleted inserted replaced
142:5ce1d36e9ff5 143:32c320bba8a6
89 return; 89 return;
90 90
91 if (bmp_playback_get_playing()) 91 if (bmp_playback_get_playing())
92 bmp_playback_stop(); 92 bmp_playback_stop();
93 93
94 ip_data.playback_mutex = g_mutex_new();
95
96 g_mutex_lock(ip_data.playback_mutex);
97
94 vis_clear_data(mainwin_vis); 98 vis_clear_data(mainwin_vis);
95 vis_clear_data(playlistwin_vis); 99 vis_clear_data(playlistwin_vis);
96 svis_clear_data(mainwin_svis); 100 svis_clear_data(mainwin_svis);
97 mainwin_disable_seekbar(); 101 mainwin_disable_seekbar();
98 102
112 cfg.equalizer_bands); 116 cfg.equalizer_bands);
113 } 117 }
114 118
115 playlist_check_pos_current(); 119 playlist_check_pos_current();
116 mainwin_set_info_text(); 120 mainwin_set_info_text();
121
122 g_mutex_unlock(ip_data.playback_mutex);
117 } 123 }
118 124
119 void 125 void
120 bmp_playback_pause(void) 126 bmp_playback_pause(void)
121 { 127 {
136 } 142 }
137 143
138 void 144 void
139 bmp_playback_stop(void) 145 bmp_playback_stop(void)
140 { 146 {
147 g_mutex_lock(ip_data.playback_mutex);
148
141 if (ip_data.playing && get_current_input_plugin()) { 149 if (ip_data.playing && get_current_input_plugin()) {
142 ip_data.playing = FALSE; 150 ip_data.playing = FALSE;
143 151
144 if (bmp_playback_get_paused()) 152 if (bmp_playback_get_paused())
145 bmp_playback_pause(); 153 bmp_playback_pause();
156 mainwin_set_info_text(); 164 mainwin_set_info_text();
157 } 165 }
158 } 166 }
159 167
160 ip_data.playing = FALSE; 168 ip_data.playing = FALSE;
169
170 g_mutex_unlock(ip_data.playback_mutex);
171 g_mutex_free(ip_data.playback_mutex);
161 } 172 }
162 173
163 174
164 static void 175 static void
165 run_no_output_plugin_dialog(void) 176 run_no_output_plugin_dialog(void)