changeset 2355:0962a6325b9b

modified pulseaudio, but it only supports 16 and 32bit output
author Cristi Magherusan <majeru@atheme.org>
date Mon, 04 Feb 2008 16:35:54 +0200
parents 6b854a93649c
children c5fa65cb26ca
files src/pulse_audio/pulse_audio.c
diffstat 1 files changed, 37 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/pulse_audio/pulse_audio.c	Mon Feb 04 15:54:01 2008 +0200
+++ b/src/pulse_audio/pulse_audio.c	Mon Feb 04 16:35:54 2008 +0200
@@ -548,17 +548,43 @@
     g_assert(!stream);
     g_assert(!connected);
 
-    if (fmt == FMT_U8)
-        ss.format = PA_SAMPLE_U8;
-    else if (fmt == FMT_S16_LE)
-        ss.format = PA_SAMPLE_S16LE;
-    else if (fmt == FMT_S16_BE)
-        ss.format = PA_SAMPLE_S16BE;
-    else if (fmt == FMT_S16_NE)
-        ss.format = PA_SAMPLE_S16NE;
-    else
-        return FALSE;
-
+    switch(fmt)
+    {
+        case FMT_U8:
+            ss.format = PA_SAMPLE_U8;
+            break;
+        case FMT_S16_LE:
+            ss.format = PA_SAMPLE_S16LE;
+            break;
+        case FMT_S16_BE:
+            ss.format = PA_SAMPLE_S16BE;
+            break;
+        case FMT_S16_NE:
+            ss.format = PA_SAMPLE_S16NE;
+            break;
+#if 0 /* pulseaudio only handles 16 and 32bit formats*/
+        case FMT_S24_LE:
+            ss.format = PA_SAMPLE_S24LE;
+            break;
+        case FMT_S24_BE:
+            ss.format = PA_SAMPLE_S24BE;
+            break;
+        case FMT_S24_NE:
+            ss.format = PA_SAMPLE_S24NE;
+            break;
+#endif
+        case FMT_S32_LE:
+            ss.format = PA_SAMPLE_S32LE;
+            break;
+        case FMT_S32_BE:
+            ss.format = PA_SAMPLE_S32BE;
+            break;
+        case FMT_S32_NE:
+            ss.format = PA_SAMPLE_S32NE;
+            break;
+        default:
+            return FALSE;
+    }
     ss.rate = rate;
     ss.channels = nch;