diff --git a/ChangeLog b/ChangeLog index 4ba07a87d8..5e82ed9743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-08-08 Wim Taymans + + Patch by: Olivier Crete + + * gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps): + * gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_setcaps): + Make mode property a string. Fixes #464475. + 2007-08-05 Stefan Kost * ext/flac/gstflacenc.c: diff --git a/gst/rtp/gstrtpilbcdepay.c b/gst/rtp/gstrtpilbcdepay.c index 3ab1611d90..a8290561d8 100644 --- a/gst/rtp/gstrtpilbcdepay.c +++ b/gst/rtp/gstrtpilbcdepay.c @@ -56,7 +56,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", "media = (string) \"audio\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " "clock-rate = (int) 8000, " - "encoding-name = (string) \"ILBC\", " "mode = (int) { 20, 30 }") + "encoding-name = (string) \"ILBC\", " + "mode = (string) { \"20\", \"30\" }") ); static GstStaticPadTemplate gst_rtp_ilbc_depay_src_template = @@ -149,14 +150,22 @@ gst_rtp_ilbc_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) GstRTPiLBCDepay *rtpilbcdepay = GST_RTP_ILBC_DEPAY (depayload); GstCaps *srccaps; GstStructure *structure; + const gchar *mode_str = NULL; gint mode; gboolean ret; structure = gst_caps_get_structure (caps, 0); - /* parse mode, if we can */ mode = rtpilbcdepay->mode; - gst_structure_get_int (structure, "mode", &mode); + + /* parse mode, if we can */ + mode_str = gst_structure_get_string (structure, "mode"); + if (mode_str) { + mode = strtol (mode_str, NULL, 10); + if (mode != 20 && mode != 30) + mode = rtpilbcdepay->mode; + } + rtpilbcdepay->mode = mode; srccaps = gst_caps_new_simple ("audio/x-iLBC", diff --git a/gst/rtp/gstrtpilbcpay.c b/gst/rtp/gstrtpilbcpay.c index 736e633dd2..708f5357f0 100644 --- a/gst/rtp/gstrtpilbcpay.c +++ b/gst/rtp/gstrtpilbcpay.c @@ -50,7 +50,8 @@ GST_STATIC_PAD_TEMPLATE ("src", "media = (string) \"audio\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " "clock-rate = (int) 8000, " - "encoding-name = (string) \"ILBC\", " "mode = (int) {20, 30}") + "encoding-name = (string) \"ILBC\", " + "mode = (string) { \"20\", \"30\" }") ); static gboolean gst_rtpilbcpay_setcaps (GstBaseRTPPayload * payload, @@ -116,6 +117,7 @@ gst_rtpilbcpay_setcaps (GstBaseRTPPayload * basertppayload, GstCaps * caps) GstBaseRTPAudioPayload *basertpaudiopayload; gboolean ret; gint mode; + gchar *mode_str; GstStructure *structure; const char *payload_name; @@ -137,9 +139,13 @@ gst_rtpilbcpay_setcaps (GstBaseRTPPayload * basertppayload, GstCaps * caps) gst_base_rtp_audio_payload_set_frame_options (basertpaudiopayload, mode, mode == 30 ? 50 : 38); + + mode_str = g_strdup_printf ("%d", mode); ret = - gst_basertppayload_set_outcaps (basertppayload, "mode", G_TYPE_INT, mode, - NULL); + gst_basertppayload_set_outcaps (basertppayload, "mode", G_TYPE_STRING, + mode_str, NULL); + g_free (mode_str); + if (mode != rtpilbcpay->mode && rtpilbcpay->mode != -1) goto mode_changed;