Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / gst / rtp / gstrtppcmadepay.c
index 27d463f..4d4a80e 100644 (file)
@@ -46,18 +46,18 @@ static GstStaticPadTemplate gst_rtp_pcma_depay_sink_template =
     GST_STATIC_CAPS ("application/x-rtp, "
         "media = (string) \"audio\", "
         "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", "
-        "clock-rate = (int) 8000, " "encoding-name = (string) \"PCMA\";"
+        "clock-rate = (int) [1, MAX ], " "encoding-name = (string) \"PCMA\";"
         "application/x-rtp, "
         "media = (string) \"audio\", "
         "payload = (int) " GST_RTP_PAYLOAD_PCMA_STRING ", "
-        "clock-rate = (int) 8000")
+        "clock-rate = (int) [1, MAX ]")
     );
 
 static GstStaticPadTemplate gst_rtp_pcma_depay_src_template =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-alaw, channels = (int) 1, rate = (int) 8000")
+    GST_STATIC_CAPS ("audio/x-alaw, channels = (int) 1, rate = (int) [1, MAX ]")
     );
 
 static GstBuffer *gst_rtp_pcma_depay_process (GstBaseRTPDepayload * depayload,
@@ -144,12 +144,14 @@ gst_rtp_pcma_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
   outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
   gst_rtp_buffer_unmap (&rtp);
 
-  GST_BUFFER_DURATION (outbuf) =
-      gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
+  if (outbuf) {
+    GST_BUFFER_DURATION (outbuf) =
+        gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
 
-  if (marker) {
-    /* mark start of talkspurt with DISCONT */
-    GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+    if (marker) {
+      /* mark start of talkspurt with DISCONT */
+      GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+    }
   }