diff 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
line wrap: on
line diff
--- a/src/psf2/plugin.c	Mon Jun 30 23:17:59 2008 -0500
+++ b/src/psf2/plugin.c	Mon Jun 30 23:39:49 2008 -0500
@@ -174,15 +174,32 @@
 		psf2_execute(data);
 	}	
 
+	psf2_stop();
+
+	data->output->buffer_free();
+	data->output->buffer_free();
+
+	data->output->close_audio();
+
 	g_free(buffer);
 	g_free(path);
         g_free(title);
+
+	data->playing = FALSE;
 }
 
 void psf2_update(unsigned char *buffer, long count, InputPlayback *playback)
 {
 	const int mask = ~((((16 / 8) * 2)) - 1);
 
+	if (buffer == NULL)
+	{
+		playback->playing = FALSE;
+		playback->eof = TRUE;
+
+		return;
+	}
+
 	while (count > 0)
 	{
 		int t = playback->output->buffer_free() & mask;