handle missing audio-drivers better
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1270 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
1ee09f6688
commit
162bc366b3
10
rdesktop.c
10
rdesktop.c
@ -690,12 +690,15 @@ main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
g_rdpsnd = True;
|
||||
if (!rdpsnd_select_driver
|
||||
(driver, options))
|
||||
{
|
||||
warning("Driver not available\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_rdpsnd = True;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
@ -715,11 +718,14 @@ main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
#ifdef WITH_RDPSND
|
||||
g_rdpsnd = True;
|
||||
if (!rdpsnd_select_driver(NULL, NULL))
|
||||
{
|
||||
warning("No sound-driver available\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_rdpsnd = True;
|
||||
}
|
||||
#else
|
||||
warning("Not compiled with sound support\n");
|
||||
#endif
|
||||
|
35
rdpsnd.c
35
rdpsnd.c
@ -289,20 +289,29 @@ rdpsnd_init(void)
|
||||
BOOL
|
||||
rdpsnd_auto_open(void)
|
||||
{
|
||||
current_driver = drivers;
|
||||
while (current_driver != NULL)
|
||||
{
|
||||
DEBUG(("trying %s...\n", current_driver->name));
|
||||
if (current_driver->wave_out_open())
|
||||
{
|
||||
DEBUG(("selected %s\n", current_driver->name));
|
||||
return True;
|
||||
}
|
||||
g_dsp_fd = 0;
|
||||
current_driver = current_driver->next;
|
||||
}
|
||||
static BOOL failed = False;
|
||||
|
||||
warning("no working audio-driver found\n");
|
||||
if (!failed)
|
||||
{
|
||||
struct audio_driver *auto_driver = current_driver;
|
||||
|
||||
current_driver = drivers;
|
||||
while (current_driver != NULL)
|
||||
{
|
||||
DEBUG(("trying %s...\n", current_driver->name));
|
||||
if (current_driver->wave_out_open())
|
||||
{
|
||||
DEBUG(("selected %s\n", current_driver->name));
|
||||
return True;
|
||||
}
|
||||
g_dsp_fd = 0;
|
||||
current_driver = current_driver->next;
|
||||
}
|
||||
|
||||
warning("no working audio-driver found\n");
|
||||
failed = True;
|
||||
current_driver = auto_driver;
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user