50 |
/* Non-blocking so that user interface is responsive */ |
/* Non-blocking so that user interface is responsive */ |
51 |
fcntl(g_dsp_fd, F_SETFL, fcntl(g_dsp_fd, F_GETFL) | O_NONBLOCK); |
fcntl(g_dsp_fd, F_SETFL, fcntl(g_dsp_fd, F_GETFL) | O_NONBLOCK); |
52 |
|
|
|
rdpsnd_queue_init(); |
|
53 |
g_reopened = True; |
g_reopened = True; |
54 |
|
|
55 |
return True; |
return True; |
60 |
{ |
{ |
61 |
/* Ack all remaining packets */ |
/* Ack all remaining packets */ |
62 |
while (!rdpsnd_queue_empty()) |
while (!rdpsnd_queue_empty()) |
63 |
{ |
rdpsnd_queue_next(0); |
|
rdpsnd_send_completion(rdpsnd_queue_current_packet()->tick, |
|
|
rdpsnd_queue_current_packet()->index); |
|
|
rdpsnd_queue_next(); |
|
|
} |
|
64 |
|
|
65 |
#if defined I_FLUSH && defined FLUSHW |
#if defined I_FLUSH && defined FLUSHW |
66 |
/* Flush the audiobuffer */ |
/* Flush the audiobuffer */ |
230 |
samplecnt += numsamples; |
samplecnt += numsamples; |
231 |
/* We need to add 50 to tell windows that time has passed while |
/* We need to add 50 to tell windows that time has passed while |
232 |
* playing this packet */ |
* playing this packet */ |
233 |
rdpsnd_send_completion(packet->tick + 50, packet->index); |
rdpsnd_queue_next(50); |
|
rdpsnd_queue_next(); |
|
234 |
sentcompletion = True; |
sentcompletion = True; |
235 |
} |
} |
236 |
else |
else |
242 |
} |
} |
243 |
} |
} |
244 |
|
|
245 |
|
static struct audio_driver sun_driver = { |
246 |
|
.name = "sun", |
247 |
|
.description = "SUN/BSD output driver, default device: " DEFAULTDEVICE " or $AUDIODEV", |
248 |
|
|
249 |
|
.wave_out_open = sun_open, |
250 |
|
.wave_out_close = sun_close, |
251 |
|
.wave_out_format_supported = sun_format_supported, |
252 |
|
.wave_out_set_format = sun_set_format, |
253 |
|
.wave_out_volume = sun_volume, |
254 |
|
.wave_out_play = sun_play, |
255 |
|
|
256 |
|
.need_byteswap_on_be = 1, |
257 |
|
.need_resampling = 0, |
258 |
|
}; |
259 |
|
|
260 |
struct audio_driver * |
struct audio_driver * |
261 |
sun_register(char *options) |
sun_register(char *options) |
262 |
{ |
{ |
|
static struct audio_driver sun_driver; |
|
|
|
|
|
sun_driver.wave_out_write = rdpsnd_queue_write; |
|
|
sun_driver.wave_out_open = sun_open; |
|
|
sun_driver.wave_out_close = sun_close; |
|
|
sun_driver.wave_out_format_supported = sun_format_supported; |
|
|
sun_driver.wave_out_set_format = sun_set_format; |
|
|
sun_driver.wave_out_volume = sun_volume; |
|
|
sun_driver.wave_out_play = sun_play; |
|
|
sun_driver.name = xstrdup("sun"); |
|
|
sun_driver.description = |
|
|
xstrdup("SUN/BSD output driver, default device: " DEFAULTDEVICE " or $AUDIODEV"); |
|
|
sun_driver.need_byteswap_on_be = 1; |
|
|
sun_driver.next = NULL; |
|
|
|
|
263 |
if (options) |
if (options) |
264 |
{ |
{ |
265 |
dsp_dev = xstrdup(options); |
dsp_dev = xstrdup(options); |