summaryrefslogtreecommitdiffstats
path: root/gst/rtp/gstrtpilbcdepay.c
diff options
context:
space:
mode:
authorOlivier Crete <tester@tester.ca>2007-08-08 10:54:50 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-08-08 10:54:50 +0000
commitcfc23b6130ff1ff4fba44750e9c03ac47099ff1f (patch)
tree053855874aa1fed5a2a1b50e373c9dcb1db27bce /gst/rtp/gstrtpilbcdepay.c
parent04bae8775a73641649a81f37dac0189382c9673c (diff)
gst/rtp/: Make mode property a string. Fixes #464475.
Original commit message from CVS: Patch by: Olivier Crete <tester at tester dot ca> * gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps): * gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_setcaps): Make mode property a string. Fixes #464475.
Diffstat (limited to 'gst/rtp/gstrtpilbcdepay.c')
-rw-r--r--gst/rtp/gstrtpilbcdepay.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gst/rtp/gstrtpilbcdepay.c b/gst/rtp/gstrtpilbcdepay.c
index 3ab1611d..a8290561 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",