43 |
libao_open(void) |
libao_open(void) |
44 |
{ |
{ |
45 |
ao_sample_format format; |
ao_sample_format format; |
|
static int warned = 0; |
|
46 |
|
|
47 |
if (!warned && libao_device) |
ao_initialize(); |
48 |
|
|
49 |
|
if (libao_device) |
50 |
{ |
{ |
51 |
warning("device-options not supported for libao-driver\n"); |
default_driver = ao_driver_id(libao_device); |
52 |
warned = 1; |
} |
53 |
|
else |
54 |
|
{ |
55 |
|
default_driver = ao_default_driver_id(); |
56 |
} |
} |
|
|
|
|
ao_initialize(); |
|
|
default_driver = ao_default_driver_id(); |
|
57 |
|
|
58 |
format.bits = 16; |
format.bits = 16; |
59 |
format.channels = 2; |
format.channels = 2; |
234 |
libao_register(char *options) |
libao_register(char *options) |
235 |
{ |
{ |
236 |
static struct audio_driver libao_driver; |
static struct audio_driver libao_driver; |
237 |
|
struct ao_info *libao_info; |
238 |
|
static char description[101]; |
239 |
|
|
240 |
libao_driver.wave_out_write = rdpsnd_queue_write; |
libao_driver.wave_out_write = rdpsnd_queue_write; |
241 |
libao_driver.wave_out_open = libao_open; |
libao_driver.wave_out_open = libao_open; |
245 |
libao_driver.wave_out_volume = rdpsnd_dsp_softvol_set; |
libao_driver.wave_out_volume = rdpsnd_dsp_softvol_set; |
246 |
libao_driver.wave_out_play = libao_play; |
libao_driver.wave_out_play = libao_play; |
247 |
libao_driver.name = xstrdup("libao"); |
libao_driver.name = xstrdup("libao"); |
248 |
libao_driver.description = xstrdup("libao output driver"); |
libao_driver.description = description; |
249 |
libao_driver.need_byteswap_on_be = 0; |
libao_driver.need_byteswap_on_be = 0; |
250 |
libao_driver.next = NULL; |
libao_driver.next = NULL; |
251 |
|
|
252 |
|
ao_initialize(); |
253 |
|
|
254 |
|
libao_info = ao_driver_info(ao_default_driver_id()); |
255 |
|
|
256 |
|
if (libao_info) |
257 |
|
{ |
258 |
|
snprintf(description, 100, "libao output driver, default device: %s", |
259 |
|
libao_info->short_name); |
260 |
|
} |
261 |
|
else |
262 |
|
{ |
263 |
|
snprintf(description, 100, "libao output driver, default device: none"); |
264 |
|
} |
265 |
|
|
266 |
|
ao_shutdown(); |
267 |
|
|
268 |
if (options) |
if (options) |
269 |
{ |
{ |
270 |
libao_device = xstrdup(options); |
libao_device = xstrdup(options); |