comparison Plugins/Input/console/Audacious_Driver.cpp @ 102:de414e40f772 trunk

[svn] Normal sound decoding, now to just figure out how to stop the decode_thread when we need to.
author nenolod
date Wed, 02 Nov 2005 18:38:59 -0800
parents 59ba6595fdf1
children 948027ac55be
comparison
equal deleted inserted replaced
101:59ba6595fdf1 102:de414e40f772
90 spc->load(header, reader); 90 spc->load(header, reader);
91 spc->start_track(0); 91 spc->start_track(0);
92 92
93 decode_thread = g_thread_create(play_loop, spc, TRUE, NULL); 93 decode_thread = g_thread_create(play_loop, spc, TRUE, NULL);
94 94
95 if (!console_ip.output->open_audio(MY_FMT, 32000, 1)) 95 if (!console_ip.output->open_audio(MY_FMT, 32000, 2))
96 return; 96 return;
97 97
98 printf("decode_thread started.\n"); 98 printf("decode_thread started.\n");
99 } 99 }
100 100
156 { 156 {
157 console_ip.add_vis_pcm(console_ip.output->written_time(), 157 console_ip.add_vis_pcm(console_ip.output->written_time(),
158 MY_FMT, 1, 4096, buf); 158 MY_FMT, 1, 4096, buf);
159 while(console_ip.output->buffer_free() < 4096) 159 while(console_ip.output->buffer_free() < 4096)
160 xmms_usleep(10000); 160 xmms_usleep(10000);
161 console_ip.output->write_audio(buf, 4096); 161 console_ip.output->write_audio(buf, 8192);
162 } 162 }
163 163
164 delete spc; 164 delete spc;
165 g_thread_exit(NULL); 165 g_thread_exit(NULL);
166 166