From 7ae1871c7506a6a5d772063e3cf45db7d9191967 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 6 Nov 2008 12:14:51 +0000 Subject: [PATCH] gst-libs/gst/riff/riff-media.c: Fix case where we don't have a range for the rates or channels as is the case with tr... 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 | 6 ++++++ gst-libs/gst/riff/riff-media.c | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd2b41e55..65c52709a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-06 Wim Taymans + + * 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 * gst/volume/gstvolume.c: (volume_update_real_volume), diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index 45458ca9b..21e885cbc 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -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, -- 2.34.1