comparison src/audio/dma/SDL_dmaaudio.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 103bbe13f5eb
children
comparison
equal deleted inserted replaced
3845:ee5dfa7f7993 3846:66fb40445587
114 { 114 {
115 free_device_list(&outputDevices, &outputDeviceCount); 115 free_device_list(&outputDevices, &outputDeviceCount);
116 free_device_list(&inputDevices, &inputDeviceCount); 116 free_device_list(&inputDevices, &inputDeviceCount);
117 } 117 }
118 118
119 static int
120 DMA_Available(void)
121 {
122 int available = 0;
123 build_device_lists();
124 available = ((outputDeviceCount > 0) || (inputDeviceCount > 0));
125 free_device_lists();
126 return available;
127 }
128 119
129 static void DMA_Deinitialize(void) 120 static void DMA_Deinitialize(void)
130 { 121 {
131 free_device_lists(); 122 free_device_lists();
132 } 123 }
535 build_device_lists(); 526 build_device_lists();
536 return 1; 527 return 1;
537 } 528 }
538 529
539 AudioBootStrap DMA_bootstrap = { 530 AudioBootStrap DMA_bootstrap = {
540 DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio", 531 DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio", DMA_Init, 0
541 DMA_Available, DMA_Init, 0
542 }; 532 };
543 533
544 /* vi: set ts=4 sw=4 expandtab: */ 534 /* vi: set ts=4 sw=4 expandtab: */