changeset 68:d435a3abc035 trunk

[svn] - set alac::going before we fork the decoder thread off, this stops the core from getting confused
author nenolod
date Sat, 30 Sep 2006 23:09:09 -0700
parents 41e2dc106f4e
children 08c9353a9bb3
files ChangeLog src/alac/plugin.c
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 30 22:57:56 2006 -0700
+++ b/ChangeLog	Sat Sep 30 23:09:09 2006 -0700
@@ -1,3 +1,12 @@
+2006-10-01 05:57:56 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [134]
+  - remove spurious debugging notices
+  
+  trunk/src/alac/demux.c  |   88 +++---------------------------------------------
+  trunk/src/alac/plugin.c |   27 +-------------
+  2 files changed, 9 insertions(+), 106 deletions(-)
+
+
 2006-10-01 05:44:36 +0000  William Pitcock <nenolod@nenolod.net>
   revision [132]
   - get_time() implementation
--- a/src/alac/plugin.c	Sat Sep 30 22:57:56 2006 -0700
+++ b/src/alac/plugin.c	Sat Sep 30 23:09:09 2006 -0700
@@ -88,11 +88,13 @@
 
 static void play_file(char *filename)
 {
+    going = 1;
     playback_thread = g_thread_create(decode_thread, filename, TRUE, NULL);
 }
 
 static void stop(void)
 {
+    going = 0;
     g_thread_join(playback_thread);
     output_close_audio();
 }
@@ -179,7 +181,7 @@
 
     buffer = malloc(buffer_size);
 
-    for (i = 0; i < demux_res->num_sample_byte_sizes; i++)
+    for (i = 0; i < demux_res->num_sample_byte_sizes && going == 1; i++)
     {
         uint32_t sample_duration;
         uint32_t sample_byte_size;
@@ -239,8 +241,6 @@
     alac_ip.output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels);
     alac_ip.set_info((char *) args, -1, -1, demux_res.sample_rate, demux_res.num_channels);
 
-    going = 1;
-
     /* will convert the entire buffer */
     GetBuffer(&demux_res);