From cbc2ba660f4635ac1cf316ebadcad9f7076c0cb1 Mon Sep 17 00:00:00 2001
From: Martin Konecny <martin@localhost.localdomain>
Date: Fri, 2 Dec 2011 13:36:59 -0500
Subject: [PATCH] CC-3074: Give users the choice of which hardware sound API
 they wish to use (instead of hardcoded to ALSA)

-done
---
 .../pypo/liquidsoap_scripts/ls_script.liq     | 35 +++++++++++++------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq
index 5eb81cf62..4e72261bb 100644
--- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq
+++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq
@@ -53,35 +53,50 @@ add_skip_command(s)
 s = map_metadata(append_title, s)
 
 if output_sound_device then
-	output.prefered=output.dummy
-	%ifdef output.alsa
+	
+    success = ref false
+    
+    log(output_sound_device_type)
+	
+    %ifdef output.alsa
 	if output_sound_device_type == "ALSA" then
-		output.prefered=output.alsa
+		ignore(output.alsa(s))
+        success := true
 	end
 	%endif
+    
 	%ifdef output.ao
 	if output_sound_device_type == "AO" then
-		output.prefered=output.ao
-		output.prefered(mksafe(s))
+		ignore(output.ao(s))
+        success := true
 	end
 	%endif
+    
 	%ifdef output.oss
 	if output_sound_device_type == "OSS" then
-		output.prefered=output.oss
+        ignore(output.oss(s))
+        success := true
 	end
 	%endif
+    
 	%ifdef output.portaudio
 	if output_sound_device_type == "Portaudio" then
-		output.prefered=output.portaudio
+        ignore(output.portaudio(s))
+        success := true
 	end
 	%endif
+    
 	%ifdef output.pulseaudio
 	if output_sound_device_type == "Pulseaudio" then
-		output.prefered=output.pulseaudio
+        ignore(output.pulseaudio(s))
+        success := true
 	end
 	%endif
-	
-    ignore(out(s))
+    
+    if (!success == false) then
+        ignore(output.prefered(s))
+	end
+    
 end
 
 if s1_enable == true then