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:
Michael Gernoth 2006-09-18 21:42:50 +00:00
parent 1ee09f6688
commit 162bc366b3
2 changed files with 30 additions and 15 deletions

View File

@ -690,12 +690,15 @@ main(int argc, char *argv[])
} }
} }
g_rdpsnd = True;
if (!rdpsnd_select_driver if (!rdpsnd_select_driver
(driver, options)) (driver, options))
{ {
warning("Driver not available\n"); warning("Driver not available\n");
} }
else
{
g_rdpsnd = True;
}
} }
#else #else
@ -715,11 +718,14 @@ main(int argc, char *argv[])
else else
{ {
#ifdef WITH_RDPSND #ifdef WITH_RDPSND
g_rdpsnd = True;
if (!rdpsnd_select_driver(NULL, NULL)) if (!rdpsnd_select_driver(NULL, NULL))
{ {
warning("No sound-driver available\n"); warning("No sound-driver available\n");
} }
else
{
g_rdpsnd = True;
}
#else #else
warning("Not compiled with sound support\n"); warning("Not compiled with sound support\n");
#endif #endif

View File

@ -289,6 +289,12 @@ rdpsnd_init(void)
BOOL BOOL
rdpsnd_auto_open(void) rdpsnd_auto_open(void)
{ {
static BOOL failed = False;
if (!failed)
{
struct audio_driver *auto_driver = current_driver;
current_driver = drivers; current_driver = drivers;
while (current_driver != NULL) while (current_driver != NULL)
{ {
@ -303,6 +309,9 @@ rdpsnd_auto_open(void)
} }
warning("no working audio-driver found\n"); warning("no working audio-driver found\n");
failed = True;
current_driver = auto_driver;
}
return False; return False;
} }