ppc fixes (Jocelyn Mayer)
[qemu] / audio / audio.c
index ec77c25..0c0c8dd 100644 (file)
@@ -24,7 +24,6 @@
 #include <assert.h>
 #include "vl.h"
 
-#define USE_SDL_AUDIO
 #define USE_WAV_AUDIO
 
 #include "audio/audio_int.h"
@@ -183,7 +182,6 @@ int pcm_hw_alloc_resources (HWVoice *hw)
     return 0;
 }
 
-
 void pcm_hw_fini (HWVoice *hw)
 {
     if (hw->active) {
@@ -369,14 +367,15 @@ static int dist (void *hw)
 {
     if (hw) {
         return (((uint8_t *) hw - (uint8_t *) hw_voices)
-                / audio_state.voice_size) + 1;
+                / audio_state.drv->voice_size) + 1;
     }
     else {
         return 0;
     }
 }
 
-#define ADVANCE(hw) hw ? advance (hw, audio_state.voice_size) : hw_voices
+#define ADVANCE(hw) \
+    ((hw) ? advance (hw, audio_state.drv->voice_size) : hw_voices)
 
 HWVoice *pcm_hw_find_any (HWVoice *hw)
 {
@@ -780,12 +779,13 @@ static struct audio_output_driver *drvtab[] = {
 #ifdef CONFIG_OSS
     &oss_output_driver,
 #endif
-#ifdef USE_FMOD_AUDIO
+#ifdef CONFIG_FMOD
     &fmod_output_driver,
 #endif
 #ifdef CONFIG_SDL
     &sdl_output_driver,
 #endif
+    &no_output_driver,
 #ifdef USE_WAV_AUDIO
     &wav_output_driver,
 #endif
@@ -906,6 +906,6 @@ void AUD_init (void)
     register_savevm ("audio", 0, 1, audio_save, audio_load, NULL);
     if (!done) {
         dolog ("Can not initialize audio subsystem\n");
-        return;
+        voice_init (&no_output_driver);
     }
 }