]> git.proxmox.com Git - qemu.git/commitdiff
audio: Remove conditional around sw which can not be NULL
authormalc <av1474@comtv.ru>
Wed, 18 Nov 2009 16:15:19 +0000 (19:15 +0300)
committermalc <av1474@comtv.ru>
Wed, 18 Nov 2009 16:22:53 +0000 (19:22 +0300)
Noticed by Steve Grubb.

Signed-off-by: malc <av1474@comtv.ru>
audio/audio_template.h

index 14c648c05fe9b372f0f56bb5d1361949b772bf74..1a4707b2ea64d3a317a026efe49bf4f1a1f0130e 100644 (file)
@@ -485,32 +485,30 @@ SW *glue (AUD_open_, TYPE) (
         }
     }
 
-    if (sw) {
-        sw->card = card;
-        sw->vol = nominal_volume;
-        sw->callback.fn = callback_fn;
-        sw->callback.opaque = callback_opaque;
+    sw->card = card;
+    sw->vol = nominal_volume;
+    sw->callback.fn = callback_fn;
+    sw->callback.opaque = callback_opaque;
 
 #ifdef DAC
-        if (live) {
-            int mixed =
-                (live << old_sw->info.shift)
-                * old_sw->info.bytes_per_second
-                / sw->info.bytes_per_second;
+    if (live) {
+        int mixed =
+            (live << old_sw->info.shift)
+            * old_sw->info.bytes_per_second
+            / sw->info.bytes_per_second;
 
 #ifdef DEBUG_PLIVE
-            dolog ("Silence will be mixed %d\n", mixed);
+        dolog ("Silence will be mixed %d\n", mixed);
 #endif
-            sw->total_hw_samples_mixed += mixed;
-        }
+        sw->total_hw_samples_mixed += mixed;
+    }
 #endif
 
 #ifdef DEBUG_AUDIO
-        dolog ("%s\n", name);
-        audio_pcm_print_info ("hw", &sw->hw->info);
-        audio_pcm_print_info ("sw", &sw->info);
+    dolog ("%s\n", name);
+    audio_pcm_print_info ("hw", &sw->hw->info);
+    audio_pcm_print_info ("sw", &sw->info);
 #endif
-    }
 
     return sw;