Mercurial > audlegacy-plugins
diff src/alac/plugin.c @ 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 |
line wrap: on
line diff
--- 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);