From 86c7231daea6215b1c8c33abed16cf7948e0cf27 Mon Sep 17 00:00:00 2001 From: Havard Graff Date: Sun, 26 Jun 2016 22:25:46 +0200 Subject: [PATCH] rtprtxreceive: allow passthrough and non-rtp buffers To avoid mapping rtp buffers when RTX is not in use, and to not do a full error on receiving a non-rtp buffer, since you have no control of what a rouge sender might send you. Part-of: --- .../gst/rtpmanager/gstrtprtxreceive.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxreceive.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxreceive.c index 44adbb46f4..2a4cfc5417 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxreceive.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxreceive.c @@ -530,6 +530,9 @@ gst_rtp_rtx_receive_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) gboolean is_rtx; gboolean drop = FALSE; + if (rtx->rtx_pt_map_structure == NULL) + goto no_map; + /* map current rtp packet to parse its header */ if (!gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp)) goto invalid_buffer; @@ -679,10 +682,14 @@ gst_rtp_rtx_receive_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) return ret; +no_map: + { + GST_DEBUG_OBJECT (pad, "No map set, passthrough"); + return gst_pad_push (rtx->srcpad, buffer); + } invalid_buffer: { - GST_ELEMENT_WARNING (rtx, STREAM, DECODE, (NULL), - ("Received invalid RTP payload, dropping")); + GST_INFO_OBJECT (pad, "Received invalid RTP payload, dropping"); gst_buffer_unref (buffer); return GST_FLOW_OK; }