Mercurial > audlegacy
comparison audacious/playback.c @ 152:274c85015c90 trunk
[svn] Remove the fucking mutex system that broke.
author | nenolod |
---|---|
date | Sat, 12 Nov 2005 14:15:48 -0800 |
parents | 0faf2fa7fc85 |
children | 6dc4483b4c4c |
comparison
equal
deleted
inserted
replaced
151:0a2963adefab | 152:274c85015c90 |
---|---|
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 | |
98 vis_clear_data(mainwin_vis); | 94 vis_clear_data(mainwin_vis); |
99 vis_clear_data(playlistwin_vis); | 95 vis_clear_data(playlistwin_vis); |
100 svis_clear_data(mainwin_svis); | 96 svis_clear_data(mainwin_svis); |
101 mainwin_disable_seekbar(); | 97 mainwin_disable_seekbar(); |
102 | 98 |
116 cfg.equalizer_bands); | 112 cfg.equalizer_bands); |
117 } | 113 } |
118 | 114 |
119 playlist_check_pos_current(); | 115 playlist_check_pos_current(); |
120 mainwin_set_info_text(); | 116 mainwin_set_info_text(); |
121 | |
122 g_mutex_unlock(ip_data.playback_mutex); | |
123 } | 117 } |
124 | 118 |
125 void | 119 void |
126 bmp_playback_pause(void) | 120 bmp_playback_pause(void) |
127 { | 121 { |
128 g_mutex_lock(ip_data.playback_mutex); | |
129 | |
130 if (!bmp_playback_get_playing()) | 122 if (!bmp_playback_get_playing()) |
131 return; | 123 return; |
132 | 124 |
133 if (!get_current_input_plugin()) | 125 if (!get_current_input_plugin()) |
134 return; | 126 return; |
139 playstatus_set_status(mainwin_playstatus, STATUS_PAUSE); | 131 playstatus_set_status(mainwin_playstatus, STATUS_PAUSE); |
140 else | 132 else |
141 playstatus_set_status(mainwin_playstatus, STATUS_PLAY); | 133 playstatus_set_status(mainwin_playstatus, STATUS_PLAY); |
142 | 134 |
143 get_current_input_plugin()->pause(ip_data.paused); | 135 get_current_input_plugin()->pause(ip_data.paused); |
144 | |
145 g_mutex_unlock(ip_data.playback_mutex); | |
146 } | 136 } |
147 | 137 |
148 void | 138 void |
149 bmp_playback_stop(void) | 139 bmp_playback_stop(void) |
150 { | 140 { |
151 g_mutex_lock(ip_data.playback_mutex); | |
152 | |
153 if (ip_data.playing && get_current_input_plugin()) { | 141 if (ip_data.playing && get_current_input_plugin()) { |
154 ip_data.playing = FALSE; | 142 ip_data.playing = FALSE; |
155 | 143 |
156 if (bmp_playback_get_paused()) | 144 if (bmp_playback_get_paused()) |
157 bmp_playback_pause(); | 145 bmp_playback_pause(); |
168 mainwin_set_info_text(); | 156 mainwin_set_info_text(); |
169 } | 157 } |
170 } | 158 } |
171 | 159 |
172 ip_data.playing = FALSE; | 160 ip_data.playing = FALSE; |
173 | |
174 g_mutex_unlock(ip_data.playback_mutex); | |
175 g_mutex_free(ip_data.playback_mutex); | |
176 } | 161 } |
177 | 162 |
178 void | 163 void |
179 bmp_playback_stop_reentrant(void) | 164 bmp_playback_stop_reentrant(void) |
180 { | 165 { |
181 g_mutex_lock(ip_data.playback_mutex); | |
182 | |
183 if (ip_data.playing && get_current_input_plugin()) { | 166 if (ip_data.playing && get_current_input_plugin()) { |
184 ip_data.playing = FALSE; | 167 ip_data.playing = FALSE; |
185 | 168 |
186 if (bmp_playback_get_paused()) | 169 if (bmp_playback_get_paused()) |
187 bmp_playback_pause(); | 170 bmp_playback_pause(); |
195 mainwin_set_info_text(); | 178 mainwin_set_info_text(); |
196 } | 179 } |
197 } | 180 } |
198 | 181 |
199 ip_data.playing = FALSE; | 182 ip_data.playing = FALSE; |
200 | |
201 g_mutex_unlock(ip_data.playback_mutex); | |
202 g_mutex_free(ip_data.playback_mutex); | |
203 } | 183 } |
204 | 184 |
205 static void | 185 static void |
206 run_no_output_plugin_dialog(void) | 186 run_no_output_plugin_dialog(void) |
207 { | 187 { |