Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v
retrieving revision 1.3340
diff -u -p -u -p -r1.3340 ChangeLog
--- ChangeLog	29 May 2007 13:38:34 -0000	1.3340
+++ ChangeLog	31 May 2007 15:20:10 -0000
@@ -1,3 +1,12 @@
+2007-05-31  Sebastian Dröge  <slomo@circular-chaos.org>
+
+	Patch by Wim Taymans <wim@fluendo.com> with the change in both places.
+
+	* gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps):
+	In riff, the depth is stored in the size field but it just means that
+	the least significant bits are cleared. We can therefore just play
+	the sample as if it had a depth == width. Fixes #440997
+
 2007-05-29  Wim Taymans  <wim@fluendo.com>
 
 	* gst/playback/gstplaybasebin.c: (queue_overrun),
Index: gst-libs/gst/riff/riff-media.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/riff/riff-media.c,v
retrieving revision 1.88
diff -u -p -u -p -r1.88 riff-media.c
--- gst-libs/gst/riff/riff-media.c	24 May 2007 15:16:59 -0000	1.88
+++ gst-libs/gst/riff/riff-media.c	31 May 2007 15:20:12 -0000
@@ -766,7 +766,13 @@ gst_riff_create_audio_caps (guint16 code
               strf->size);
           strf->size = 8 * (guint) ceil (wd / 8.0);
         }
-        ws = strf->size;
+        /* in riff, the depth is stored in the size field but it just means that
+         * the _least_ significant bits are cleared. We can therefore just play
+         * the sample as if it had a depth == width */
+        ws = wd;
+
+        /* FIXME: This would set the correct depth.
+         * ws = strf->size; */
 
         caps = gst_caps_new_simple ("audio/x-raw-int",
             "endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
@@ -1083,11 +1089,18 @@ gst_riff_create_audio_caps (guint16 code
           GST_DEBUG ("PCM");
           if (strf != NULL) {
             gint ba = strf->blockalign;
-            gint ws = strf->size;
             gint wd = ba * 8 / strf->channels;
-
-            if (valid_bits_per_sample != 0)
-              ws = valid_bits_per_sample;
+            gint ws;
+            
+            /* in riff, the depth is stored in the size field but it just
+             * means that the _least_ significant bits are cleared. We can
+             * therefore just play the sample as if it had a depth == width */
+            ws = wd;
+
+            /* FIXME: This would set the correct depth.
+             * ws = strf->size;
+             * if (valid_bits_per_sample != 0)
+             *   ws = valid_bits_per_sample; */
 
             caps = gst_caps_new_simple ("audio/x-raw-int",
                 "endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
