comparison src/psf2/plugin.c @ 2750:6319a15e7243

Plugin is mostly usable now.
author William Pitcock <nenolod@atheme.org>
date Mon, 30 Jun 2008 23:39:49 -0500
parents 290357060cdb
children 533d73cfa1ff
comparison
equal deleted inserted replaced
2749:290357060cdb 2750:6319a15e7243
172 while (data->playing) 172 while (data->playing)
173 { 173 {
174 psf2_execute(data); 174 psf2_execute(data);
175 } 175 }
176 176
177 psf2_stop();
178
179 data->output->buffer_free();
180 data->output->buffer_free();
181
182 data->output->close_audio();
183
177 g_free(buffer); 184 g_free(buffer);
178 g_free(path); 185 g_free(path);
179 g_free(title); 186 g_free(title);
187
188 data->playing = FALSE;
180 } 189 }
181 190
182 void psf2_update(unsigned char *buffer, long count, InputPlayback *playback) 191 void psf2_update(unsigned char *buffer, long count, InputPlayback *playback)
183 { 192 {
184 const int mask = ~((((16 / 8) * 2)) - 1); 193 const int mask = ~((((16 / 8) * 2)) - 1);
194
195 if (buffer == NULL)
196 {
197 playback->playing = FALSE;
198 playback->eof = TRUE;
199
200 return;
201 }
185 202
186 while (count > 0) 203 while (count > 0)
187 { 204 {
188 int t = playback->output->buffer_free() & mask; 205 int t = playback->output->buffer_free() & mask;
189 if (t > count) 206 if (t > count)