Mercurial > sdl-ios-xcode
comparison src/audio/dsp/SDL_dspaudio.c @ 3846:66fb40445587 SDL-ryan-multiple-audio-device
Removed distinction between "available" and "init" in audio backends, since
both had to be checked for success as a pair at the higher level and several
of the Available methods were just always-succeed placeholders anyhow. Now
the availability check is done in the init code, and the higher level tries
all possible drivers until one manages to initialize successfully.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 17 Oct 2006 09:09:21 +0000 |
parents | 5b483ce86357 |
children |
comparison
equal
deleted
inserted
replaced
3845:ee5dfa7f7993 | 3846:66fb40445587 |
---|---|
91 free_device_list(&outputDevices, &outputDeviceCount); | 91 free_device_list(&outputDevices, &outputDeviceCount); |
92 free_device_list(&inputDevices, &inputDeviceCount); | 92 free_device_list(&inputDevices, &inputDeviceCount); |
93 } | 93 } |
94 | 94 |
95 | 95 |
96 static int | |
97 DSP_Available(void) | |
98 { | |
99 int available = 0; | |
100 build_device_lists(); | |
101 available = ((outputDeviceCount > 0) || (inputDeviceCount > 0)); | |
102 free_device_lists(); | |
103 return available; | |
104 } | |
105 | |
106 | |
107 static void | 96 static void |
108 DSP_Deinitialize(void) | 97 DSP_Deinitialize(void) |
109 { | 98 { |
110 free_device_lists(); | 99 free_device_lists(); |
111 } | 100 } |
386 return 1; | 375 return 1; |
387 } | 376 } |
388 | 377 |
389 | 378 |
390 AudioBootStrap DSP_bootstrap = { | 379 AudioBootStrap DSP_bootstrap = { |
391 DSP_DRIVER_NAME, "OSS /dev/dsp standard audio", | 380 DSP_DRIVER_NAME, "OSS /dev/dsp standard audio", DSP_Init, 0 |
392 DSP_Available, DSP_Init, 0 | |
393 }; | 381 }; |
394 | 382 |
395 /* vi: set ts=4 sw=4 expandtab: */ | 383 /* vi: set ts=4 sw=4 expandtab: */ |