Mercurial > audlegacy-plugins
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 67:41e2dc106f4e | 68:d435a3abc035 |
|---|---|
| 86 return TRUE; | 86 return TRUE; |
| 87 } | 87 } |
| 88 | 88 |
| 89 static void play_file(char *filename) | 89 static void play_file(char *filename) |
| 90 { | 90 { |
| 91 going = 1; | |
| 91 playback_thread = g_thread_create(decode_thread, filename, TRUE, NULL); | 92 playback_thread = g_thread_create(decode_thread, filename, TRUE, NULL); |
| 92 } | 93 } |
| 93 | 94 |
| 94 static void stop(void) | 95 static void stop(void) |
| 95 { | 96 { |
| 97 going = 0; | |
| 96 g_thread_join(playback_thread); | 98 g_thread_join(playback_thread); |
| 97 output_close_audio(); | 99 output_close_audio(); |
| 98 } | 100 } |
| 99 | 101 |
| 100 static void seek(gint time) | 102 static void seek(gint time) |
| 177 | 179 |
| 178 unsigned int i; | 180 unsigned int i; |
| 179 | 181 |
| 180 buffer = malloc(buffer_size); | 182 buffer = malloc(buffer_size); |
| 181 | 183 |
| 182 for (i = 0; i < demux_res->num_sample_byte_sizes; i++) | 184 for (i = 0; i < demux_res->num_sample_byte_sizes && going == 1; i++) |
| 183 { | 185 { |
| 184 uint32_t sample_duration; | 186 uint32_t sample_duration; |
| 185 uint32_t sample_byte_size; | 187 uint32_t sample_byte_size; |
| 186 | 188 |
| 187 int outputBytes; | 189 int outputBytes; |
| 237 init_sound_converter(&demux_res); | 239 init_sound_converter(&demux_res); |
| 238 | 240 |
| 239 alac_ip.output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels); | 241 alac_ip.output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels); |
| 240 alac_ip.set_info((char *) args, -1, -1, demux_res.sample_rate, demux_res.num_channels); | 242 alac_ip.set_info((char *) args, -1, -1, demux_res.sample_rate, demux_res.num_channels); |
| 241 | 243 |
| 242 going = 1; | |
| 243 | |
| 244 /* will convert the entire buffer */ | 244 /* will convert the entire buffer */ |
| 245 GetBuffer(&demux_res); | 245 GetBuffer(&demux_res); |
| 246 | 246 |
| 247 going = 0; | 247 going = 0; |
| 248 | 248 |
