Author: titmuss
Date: Wed May  7 13:05:37 2008
New Revision: 2434

URL: http://svn.slimdevices.com?rev=2434&root=Jive&view=rev
Log:
Bug: N/A
Description:
Added Int24Padded to Float32 converter, for osx.


Modified:
    7.2/trunk/squeezeplay/src/portaudio_v19_1360/src/common/pa_converters.c

Modified: 
7.2/trunk/squeezeplay/src/portaudio_v19_1360/src/common/pa_converters.c
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/portaudio_v19_1360/src/common/pa_converters.c?rev=2434&root=Jive&r1=2433&r2=2434&view=diff
==============================================================================
--- 7.2/trunk/squeezeplay/src/portaudio_v19_1360/src/common/pa_converters.c 
(original)
+++ 7.2/trunk/squeezeplay/src/portaudio_v19_1360/src/common/pa_converters.c Wed 
May  7 13:05:37 2008
@@ -1200,6 +1200,8 @@
     }
 }
 
+
+
 /* -------------------------------------------------------------------------- 
*/
 
 static void Int24Padded_To_Float32(
@@ -1207,13 +1209,31 @@
     void *sourceBuffer, signed int sourceStride,
     unsigned int count, struct PaUtilTriangularDitherGenerator 
*ditherGenerator )
 {
-    (void) destinationBuffer; /* unused parameters */
-    (void) destinationStride; /* unused parameters */
-    (void) sourceBuffer; /* unused parameters */
-    (void) sourceStride; /* unused parameters */
-    (void) count; /* unused parameters */
-    (void) ditherGenerator; /* unused parameters */
-    /* IMPLEMENT ME */
+    unsigned char *src = (unsigned char*)sourceBuffer;
+    float *dest = (float*)destinationBuffer;
+    PaInt32 temp;
+
+    (void) ditherGenerator; /* unused parameter */
+    
+    while( count-- )
+    {
+        /* REVIEW */
+
+#if defined(PA_LITTLE_ENDIAN)
+        temp = (((long)src[0]) << 8);  
+        temp = temp | (((long)src[1]) << 16);
+        temp = temp | (((long)src[2]) << 24);
+#elif defined(PA_BIG_ENDIAN)
+        temp = (((long)src[0]) << 24);
+        temp = temp | (((long)src[1]) << 16);
+        temp = temp | (((long)src[2]) << 8);
+#endif
+
+        *dest = (float) ((double)temp * const_1_div_2147483648_);
+
+        src += sourceStride * 4;
+        dest += destinationStride;
+    }
 }
 
 /* -------------------------------------------------------------------------- 
*/

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to