gst-libs/gst/riff/riff-media.c: Fix case where we don't have a range for the rates...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 6 Nov 2008 12:14:51 +0000 (12:14 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 6 Nov 2008 12:14:51 +0000 (12:14 +0000)
Original commit message from CVS:
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps):
Fix case where we don't have a range for the rates or channels as is the
case with truespeech.

ChangeLog
gst-libs/gst/riff/riff-media.c

index dd2b41e..65c5270 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-06  Wim Taymans  <wim.taymans@collabora.co.uk>
+
+       * gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps):
+       Fix case where we don't have a range for the rates or channels as is the
+       case with truespeech.
+
 2008-11-05  Wim Taymans  <wim.taymans@collabora.co.uk>
 
        * gst/volume/gstvolume.c: (volume_update_real_volume),
index 45458ca..21e885c 100644 (file)
@@ -1408,9 +1408,16 @@ gst_riff_create_audio_caps (guint16 codec_id,
     }
   } else {
     if (rate_chan) {
-      gst_caps_set_simple (caps,
-          "rate", GST_TYPE_INT_RANGE, rate_min, rate_max,
-          "channels", GST_TYPE_INT_RANGE, 1, channels_max, NULL);
+      if (rate_min == rate_max)
+        gst_caps_set_simple (caps, "rate", G_TYPE_INT, rate_min, NULL);
+      else
+        gst_caps_set_simple (caps,
+            "rate", GST_TYPE_INT_RANGE, rate_min, rate_max, NULL);
+      if (channels_max == 1)
+        gst_caps_set_simple (caps, "channels", G_TYPE_INT, 1, NULL);
+      else
+        gst_caps_set_simple (caps,
+            "channels", GST_TYPE_INT_RANGE, 1, channels_max, NULL);
     }
     if (block_align) {
       gst_caps_set_simple (caps,