36 |
static BOOL reopened; |
static BOOL reopened; |
37 |
static char *libao_device = NULL; |
static char *libao_device = NULL; |
38 |
|
|
39 |
|
void libao_play(void); |
40 |
|
|
41 |
|
void |
42 |
|
libao_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv) |
43 |
|
{ |
44 |
|
} |
45 |
|
|
46 |
|
void |
47 |
|
libao_check_fds(fd_set * rfds, fd_set * wfds) |
48 |
|
{ |
49 |
|
if (o_device == NULL) |
50 |
|
return; |
51 |
|
|
52 |
|
if (!rdpsnd_queue_empty()) |
53 |
|
libao_play(); |
54 |
|
} |
55 |
|
|
56 |
BOOL |
BOOL |
57 |
libao_open(void) |
libao_open(void) |
58 |
{ |
{ |
81 |
return False; |
return False; |
82 |
} |
} |
83 |
|
|
|
g_dsp_fd = 0; |
|
|
|
|
84 |
reopened = True; |
reopened = True; |
85 |
|
|
86 |
return True; |
return True; |
98 |
if (o_device != NULL) |
if (o_device != NULL) |
99 |
ao_close(o_device); |
ao_close(o_device); |
100 |
|
|
101 |
|
o_device = NULL; |
102 |
|
|
103 |
ao_shutdown(); |
ao_shutdown(); |
104 |
} |
} |
105 |
|
|
151 |
prev_us = tv.tv_usec; |
prev_us = tv.tv_usec; |
152 |
} |
} |
153 |
|
|
154 |
|
/* We shouldn't be called if the queue is empty, but still */ |
155 |
if (rdpsnd_queue_empty()) |
if (rdpsnd_queue_empty()) |
|
{ |
|
|
g_dsp_busy = 0; |
|
156 |
return; |
return; |
|
} |
|
157 |
|
|
158 |
packet = rdpsnd_queue_current_packet(); |
packet = rdpsnd_queue_current_packet(); |
159 |
out = &packet->s; |
out = &packet->s; |
185 |
|
|
186 |
rdpsnd_queue_next(duration); |
rdpsnd_queue_next(duration); |
187 |
} |
} |
|
|
|
|
g_dsp_busy = 1; |
|
|
return; |
|
188 |
} |
} |
189 |
|
|
190 |
static struct audio_driver libao_driver = { |
static struct audio_driver libao_driver = { |
191 |
.name = "libao", |
.name = "libao", |
192 |
.description = "libao output driver, default device: system dependent", |
.description = "libao output driver, default device: system dependent", |
193 |
|
|
194 |
|
.add_fds = libao_add_fds, |
195 |
|
.check_fds = libao_check_fds, |
196 |
|
|
197 |
.wave_out_open = libao_open, |
.wave_out_open = libao_open, |
198 |
.wave_out_close = libao_close, |
.wave_out_close = libao_close, |
199 |
.wave_out_format_supported = rdpsnd_dsp_resample_supported, |
.wave_out_format_supported = rdpsnd_dsp_resample_supported, |
200 |
.wave_out_set_format = libao_set_format, |
.wave_out_set_format = libao_set_format, |
201 |
.wave_out_volume = rdpsnd_dsp_softvol_set, |
.wave_out_volume = rdpsnd_dsp_softvol_set, |
|
.wave_out_play = libao_play, |
|
202 |
|
|
203 |
.need_byteswap_on_be = 1, |
.need_byteswap_on_be = 1, |
204 |
.need_resampling = 1, |
.need_resampling = 1, |