diff --git a/ChangeLog b/ChangeLog index 01d014c36f..0f462696a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,18 @@ +2007-05-31 Jan Schmidt + + * 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 + + Patch by: Wim Taymans + Patch by: Sebastian Dröge + 2007-05-31 Jan Schmidt * gst-libs/gst/floatcast/floatcast.h: Define inline when needed on win32 builds. Fixes: #441295 + Patch by: Sebastien Moutte 2007-05-29 Wim Taymans diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index 16bdae4cde..3ef5e3df21 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -766,7 +766,11 @@ gst_riff_create_audio_caps (guint16 codec_id, 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 */ + /* For reference, the actual depth is in strf->size */ + ws = wd; caps = gst_caps_new_simple ("audio/x-raw-int", "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, @@ -1083,11 +1087,18 @@ gst_riff_create_audio_caps (guint16 codec_id, GST_DEBUG ("PCM"); if (strf != NULL) { gint ba = strf->blockalign; - gint ws = strf->size; gint wd = ba * 8 / strf->channels; + gint ws; - if (valid_bits_per_sample != 0) - ws = valid_bits_per_sample; + /* 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; + + /* For reference, use this to get the actual 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,