Merge branch 'master' of github.com:Themaister/SSNES

This commit is contained in:
TwinAphex51224 2012-02-22 19:49:51 +01:00
commit 678269039b

View File

@ -86,13 +86,20 @@ static void *oss_init(const char *device, unsigned rate, unsigned latency)
return NULL;
}
if (ioctl(*fd, SNDCTL_DSP_SPEED, &rate) < 0)
int new_rate = rate;
if (ioctl(*fd, SNDCTL_DSP_SPEED, &new_rate) < 0)
{
close(*fd);
free(fd);
return NULL;
}
if (new_rate != (int)rate)
{
SSNES_WARN("Requested sample rate not supported. Adjusting output rate to %d Hz.\n", new_rate);
g_settings.audio.out_rate = new_rate;
}
return fd;
}