mirror of https://github.com/snes9xgit/snes9x.git
GTK+: OSS: Try /dev/dspN 1 through 9.
This commit is contained in:
parent
7ae93a539e
commit
c878b35610
|
@ -70,17 +70,32 @@ S9xOSSSoundDriver::open_device ()
|
||||||
|
|
||||||
printf ("OSS sound driver initializing...\n");
|
printf ("OSS sound driver initializing...\n");
|
||||||
|
|
||||||
printf (" --> (Device: /dev/dsp)...");
|
printf ("Device: /dev/dsp: ");
|
||||||
|
|
||||||
filedes = open ("/dev/dsp", O_WRONLY | O_NONBLOCK);
|
filedes = open ("/dev/dsp", O_WRONLY | O_NONBLOCK);
|
||||||
|
|
||||||
if (filedes < 0)
|
if (filedes < 0)
|
||||||
{
|
{
|
||||||
printf ("Failed\n --> (Device: /dev/dsp1)...");
|
printf ("Failed.\n");
|
||||||
filedes = open ("/dev/dsp1", O_WRONLY | O_NONBLOCK);
|
char dspstring[16] = "/dev/dspX\0";
|
||||||
|
|
||||||
if (filedes < 0)
|
for (int i = 1; i <= 9; i++)
|
||||||
goto fail;
|
{
|
||||||
|
dspstring[8] = '0' + i;
|
||||||
|
|
||||||
|
printf ("Trying %s: ", dspstring);
|
||||||
|
|
||||||
|
filedes = open (dspstring, O_WRONLY | O_NONBLOCK);
|
||||||
|
|
||||||
|
if (filedes < 0)
|
||||||
|
{
|
||||||
|
if (i == 9)
|
||||||
|
goto fail;
|
||||||
|
printf ("Failed.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("OK\n");
|
printf ("OK\n");
|
||||||
|
|
Loading…
Reference in New Issue