summaryrefslogtreecommitdiff
path: root/ext/srtp
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-04-30 21:32:29 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-04-30 21:34:54 +0200
commitdafa11b9d21d06a0273007628a2a0bb4d7858658 (patch)
treec4046684e5d30f8ccd64b58af4e3b0644791dc88 /ext/srtp
parentcf210bac27d4cb28c70c1669fa162377f41dc1f6 (diff)
srtpdec: Make sure to send caps events downstream before any segment events
Upstream might not give us a caps event (dtlssrtpdec) because it might be an RTP/RTCP mixed stream, but we split the two streams anyway and should report proper caps downstream if possible. Fixes "sticky event misordering" warnings with dtlssrtpdec.
Diffstat (limited to 'ext/srtp')
-rw-r--r--ext/srtp/gstsrtpdec.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/srtp/gstsrtpdec.c b/ext/srtp/gstsrtpdec.c
index ba3c3ccb5..4259cf969 100644
--- a/ext/srtp/gstsrtpdec.c
+++ b/ext/srtp/gstsrtpdec.c
@@ -796,6 +796,14 @@ gst_srtp_dec_sink_event_rtp (GstPad * pad, GstObject * parent, GstEvent * event)
gst_event_unref (event);
return ret;
case GST_EVENT_SEGMENT:
+ /* Make sure to send a caps event downstream before the segment event,
+ * even if upstream didn't */
+ if (!gst_pad_has_current_caps (pad)) {
+ GstCaps *caps = gst_caps_new_empty_simple ("application/x-rtp");
+
+ gst_pad_event_default (pad, parent, gst_event_new_caps (caps));
+ gst_caps_unref (caps);
+ }
filter->rtp_has_segment = TRUE;
break;
case GST_EVENT_FLUSH_STOP:
@@ -823,6 +831,14 @@ gst_srtp_dec_sink_event_rtcp (GstPad * pad, GstObject * parent,
gst_event_unref (event);
return ret;
case GST_EVENT_SEGMENT:
+ /* Make sure to send a caps event downstream before the segment event,
+ * even if upstream didn't */
+ if (!gst_pad_has_current_caps (pad)) {
+ GstCaps *caps = gst_caps_new_empty_simple ("application/x-rtcp");
+
+ gst_pad_event_default (pad, parent, gst_event_new_caps (caps));
+ gst_caps_unref (caps);
+ }
filter->rtcp_has_segment = TRUE;
break;
case GST_EVENT_FLUSH_STOP: