From d6dc1b6c4679a8f344eb4b9bb35c0a74500cc6e7 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Fri, 31 Jan 2014 00:19:16 +0100 Subject: [PATCH] rtpbasepayload: Let caps event also configure seqnum-offset Previously the sequence number kept track of by GstRTPBasePayload would only be set when going from READY to PAUSED state. This meant that a downstream element that attempted to configure a basepayloader by setting seqnum-offset e.g. in its sinkpad's caps template would have trouble configuring the basepayloader. The reason was that the caps event which arrives with the desired value for seqnum-offset did not arrive at the basepayloader until caps negotiation took place, significantly later than the transition from READY to PAUSED. The result after this patch is that the default value for the seqnum-offset property, or later set values for this property, will take effect when going from READY to PAUSED like before. In addition the an arriving caps event will also affect the basepayloaders configured sequence number as the event arrives. --- gst-libs/gst/rtp/gstrtpbasepayload.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/rtp/gstrtpbasepayload.c b/gst-libs/gst/rtp/gstrtpbasepayload.c index 83daed5cf..4ed9ba624 100644 --- a/gst-libs/gst/rtp/gstrtpbasepayload.c +++ b/gst-libs/gst/rtp/gstrtpbasepayload.c @@ -823,6 +823,9 @@ gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload, payload->seqnum_base = g_value_get_uint (value); GST_LOG_OBJECT (payload, "using peer seqnum-offset %u", payload->seqnum_base); + payload->priv->next_seqnum = payload->seqnum_base; + payload->seqnum = payload->seqnum_base; + payload->priv->seqnum_offset_random = FALSE; } else { /* FIXME, fixate_nearest_uint would be even better */ gst_structure_set (s, "seqnum-offset", G_TYPE_UINT, payload->seqnum_base, -- 2.34.1