Dummy audio and video drivers are enabled (thanks Ryan!)
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4087
This commit is contained in:
parent
32bf9a536b
commit
b28f12dc1c
3 changed files with 32 additions and 20 deletions
|
@ -80,23 +80,30 @@ static int DISKAUD_Available(void)
|
|||
int exists = 0;
|
||||
struct stat statbuf;
|
||||
const char *fname = DISKAUD_GetOutputFilename();
|
||||
|
||||
const char *envr = getenv("SDL_AUDIODRIVER");
|
||||
available = 0;
|
||||
|
||||
if (stat(fname, &statbuf) == 0)
|
||||
exists = 1;
|
||||
if ((envr) && (strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
|
||||
if (stat(fname, &statbuf) == 0)
|
||||
exists = 1;
|
||||
|
||||
fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
|
||||
if ( fd != -1 ) {
|
||||
available = 1;
|
||||
close(fd);
|
||||
if (!exists) {
|
||||
unlink(fname);
|
||||
}
|
||||
fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
|
||||
if ( fd != -1 ) {
|
||||
available = 1;
|
||||
close(fd);
|
||||
if (!exists) {
|
||||
unlink(fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(available);
|
||||
#else
|
||||
return(1);
|
||||
const char *envr = getenv("SDL_AUDIODRIVER");
|
||||
if ((envr) && (strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue