Mercurial > sdl-ios-xcode
comparison src/audio/disk/SDL_diskaudio.c @ 86:13e4c612098d
Dummy audio and video drivers are enabled (thanks Ryan!)
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Mon, 02 Jul 2001 00:20:29 +0000 |
parents | ac6645260d31 |
children | e8157fcb3114 |
comparison
equal
deleted
inserted
replaced
85:60c7960354e0 | 86:13e4c612098d |
---|---|
78 int fd; | 78 int fd; |
79 int available; | 79 int available; |
80 int exists = 0; | 80 int exists = 0; |
81 struct stat statbuf; | 81 struct stat statbuf; |
82 const char *fname = DISKAUD_GetOutputFilename(); | 82 const char *fname = DISKAUD_GetOutputFilename(); |
83 | 83 const char *envr = getenv("SDL_AUDIODRIVER"); |
84 available = 0; | 84 available = 0; |
85 | 85 |
86 if (stat(fname, &statbuf) == 0) | 86 if ((envr) && (strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) { |
87 exists = 1; | 87 if (stat(fname, &statbuf) == 0) |
88 | 88 exists = 1; |
89 fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); | 89 |
90 if ( fd != -1 ) { | 90 fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); |
91 available = 1; | 91 if ( fd != -1 ) { |
92 close(fd); | 92 available = 1; |
93 if (!exists) { | 93 close(fd); |
94 unlink(fname); | 94 if (!exists) { |
95 } | 95 unlink(fname); |
96 } | |
97 } | |
96 } | 98 } |
97 return(available); | 99 return(available); |
98 #else | 100 #else |
99 return(1); | 101 const char *envr = getenv("SDL_AUDIODRIVER"); |
102 if ((envr) && (strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) { | |
103 return(1); | |
104 } | |
105 | |
106 return(0); | |
100 #endif | 107 #endif |
101 } | 108 } |
102 | 109 |
103 static void DISKAUD_DeleteDevice(SDL_AudioDevice *device) | 110 static void DISKAUD_DeleteDevice(SDL_AudioDevice *device) |
104 { | 111 { |