Mercurial > audlegacy-plugins
comparison src/psf2/plugin.c @ 2751:533d73cfa1ff
Finalize event loop for the playback thread; the plugin is now done except for seeking.
| author | William Pitcock <nenolod@atheme.org> |
|---|---|
| date | Mon, 30 Jun 2008 23:50:51 -0500 |
| parents | 6319a15e7243 |
| children | cd2d2118fdee |
comparison
equal
deleted
inserted
replaced
| 2750:6319a15e7243 | 2751:533d73cfa1ff |
|---|---|
| 67 *length = (uint64)size; | 67 *length = (uint64)size; |
| 68 | 68 |
| 69 return AO_SUCCESS; | 69 return AO_SUCCESS; |
| 70 } | 70 } |
| 71 | 71 |
| 72 static gint seek = 0; | |
| 73 | |
| 72 Tuple *psf2_tuple(gchar *filename) | 74 Tuple *psf2_tuple(gchar *filename) |
| 73 { | 75 { |
| 74 Tuple *t; | 76 Tuple *t; |
| 75 corlett_t *c; | 77 corlett_t *c; |
| 76 guchar *buf; | 78 guchar *buf; |
| 167 | 169 |
| 168 data->set_params(data, title, length, 44100*2*2*8, 44100, 2); | 170 data->set_params(data, title, length, 44100*2*2*8, 44100, 2); |
| 169 | 171 |
| 170 data->playing = TRUE; | 172 data->playing = TRUE; |
| 171 data->set_pb_ready(data); | 173 data->set_pb_ready(data); |
| 172 while (data->playing) | 174 |
| 175 for (;;) | |
| 173 { | 176 { |
| 174 psf2_execute(data); | 177 psf2_execute(data); |
| 178 | |
| 179 if (seek) | |
| 180 { | |
| 181 seek = 0; | |
| 182 continue; | |
| 183 } | |
| 184 | |
| 185 psf2_stop(); | |
| 186 | |
| 187 data->output->buffer_free(); | |
| 188 data->output->buffer_free(); | |
| 189 | |
| 190 while (data->eof && data->output->buffer_playing()) | |
| 191 g_usleep(10000); | |
| 192 | |
| 193 data->output->close_audio(); | |
| 194 | |
| 195 break; | |
| 175 } | 196 } |
| 176 | |
| 177 psf2_stop(); | |
| 178 | |
| 179 data->output->buffer_free(); | |
| 180 data->output->buffer_free(); | |
| 181 | |
| 182 data->output->close_audio(); | |
| 183 | 197 |
| 184 g_free(buffer); | 198 g_free(buffer); |
| 185 g_free(path); | 199 g_free(path); |
| 186 g_free(title); | 200 g_free(title); |
| 187 | 201 |
