audio fixes (malc)
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 6 Dec 2004 23:14:48 +0000 (23:14 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 6 Dec 2004 23:14:48 +0000 (23:14 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1165 c046a42c-6fe2-441c-8c8c-71466251a162

audio/audio.c
audio/audio_int.h
audio/noaudio.c

index 661771e82e52839e02bf4df923d8b4392cd3f04c..0c0c8dd86f5df47a8982cfcb8b7659f546857674 100644 (file)
@@ -367,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)
 {
index db7fd1a7d369d5e9fd3bae90108fd686f8ae8288..0be2a6166249ca17875a6e144e6fce53d2e9a8bf 100644 (file)
@@ -86,7 +86,6 @@ typedef struct AudioState {
     int fixed_channels;
     int fixed_fmt;
     int nb_hw_voices;
-    int voice_size;
     int64_t ticks_threshold;
     int freq_threshold;
     void *opaque;
index 819de1e538805827e235fa8572a19c3cc272d95d..a192885a72a3b3d38db9863c36231408d715853c 100644 (file)
@@ -41,7 +41,6 @@ static void no_hw_run (HWVoice *hw)
 {
     NoVoice *no = (NoVoice *) hw;
     int rpos, live, decr, samples;
-    uint8_t *dst;
     st_sample_t *src;
     int64_t now = qemu_get_clock (vm_clock);
     int64_t ticks = now - no->old_ticks;
@@ -82,7 +81,6 @@ static int no_hw_write (SWVoice *sw, void *buf, int len)
 
 static int no_hw_init (HWVoice *hw, int freq, int nchannels, audfmt_e fmt)
 {
-    NoVoice *no = (NoVoice *) hw;
     hw->freq = freq;
     hw->nchannels = nchannels;
     hw->fmt = fmt;