Mercurial > sdl-ios-xcode
comparison src/audio/dsp/SDL_dspaudio.c @ 3820:1f156fd874fa SDL-ryan-multiple-audio-device
Moved more audio drivers to 1.3 API (all 5 MiNT backends, BSD, IRIX...), and
some other tweaks in already-converted drivers.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 07 Oct 2006 05:36:36 +0000 |
parents | 103bbe13f5eb |
children | 5b483ce86357 |
comparison
equal
deleted
inserted
replaced
3819:b225d9820ee3 | 3820:1f156fd874fa |
---|---|
56 | 56 |
57 /* Open the audio device for playback, and don't block if busy */ | 57 /* Open the audio device for playback, and don't block if busy */ |
58 #define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) | 58 #define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) |
59 #define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) | 59 #define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) |
60 | 60 |
61 /* Audio driver bootstrap functions */ | |
62 | |
63 static char **outputDevices = NULL; | 61 static char **outputDevices = NULL; |
64 static int outputDeviceCount = 0; | 62 static int outputDeviceCount = 0; |
65 static char **inputDevices = NULL; | 63 static char **inputDevices = NULL; |
66 static int inputDeviceCount = 0; | 64 static int inputDeviceCount = 0; |
67 | 65 |
104 free_device_lists(); | 102 free_device_lists(); |
105 return available; | 103 return available; |
106 } | 104 } |
107 | 105 |
108 | 106 |
109 static void DSP_Deinitialize(void) | 107 static void |
108 DSP_Deinitialize(void) | |
110 { | 109 { |
111 free_device_lists(); | 110 free_device_lists(); |
112 } | 111 } |
113 | 112 |
114 | 113 |
184 if (this->hidden == NULL) { | 183 if (this->hidden == NULL) { |
185 SDL_OutOfMemory(); | 184 SDL_OutOfMemory(); |
186 return 0; | 185 return 0; |
187 } | 186 } |
188 SDL_memset(this->hidden, 0, (sizeof *this->hidden)); | 187 SDL_memset(this->hidden, 0, (sizeof *this->hidden)); |
189 this->hidden->audio_fd = -1; | |
190 | 188 |
191 /* Open the audio device */ | 189 /* Open the audio device */ |
192 this->hidden->audio_fd = open(devname, flags, 0); | 190 this->hidden->audio_fd = open(devname, flags, 0); |
193 if (this->hidden->audio_fd < 0) { | 191 if (this->hidden->audio_fd < 0) { |
194 SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); | 192 SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); |