do not segfault when no libao default-driver is defined
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1267 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
7522bc310c
commit
c66055ab22
@ -234,6 +234,7 @@ struct audio_driver *
|
|||||||
libao_register(char *options)
|
libao_register(char *options)
|
||||||
{
|
{
|
||||||
static struct audio_driver libao_driver;
|
static struct audio_driver libao_driver;
|
||||||
|
struct ao_info *libao_info;
|
||||||
static char description[101];
|
static char description[101];
|
||||||
|
|
||||||
libao_driver.wave_out_write = rdpsnd_queue_write;
|
libao_driver.wave_out_write = rdpsnd_queue_write;
|
||||||
@ -249,8 +250,19 @@ libao_register(char *options)
|
|||||||
libao_driver.next = NULL;
|
libao_driver.next = NULL;
|
||||||
|
|
||||||
ao_initialize();
|
ao_initialize();
|
||||||
snprintf(description, 100, "libao output driver, default device: %s",
|
|
||||||
ao_driver_info(ao_default_driver_id())->short_name);
|
libao_info = ao_driver_info(ao_default_driver_id());
|
||||||
|
|
||||||
|
if (libao_info)
|
||||||
|
{
|
||||||
|
snprintf(description, 100, "libao output driver, default device: %s",
|
||||||
|
libao_info->short_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(description, 100, "libao output driver, default device: none");
|
||||||
|
}
|
||||||
|
|
||||||
ao_shutdown();
|
ao_shutdown();
|
||||||
|
|
||||||
if (options)
|
if (options)
|
||||||
|
Loading…
Reference in New Issue
Block a user