rtpbasedepayload: mark DISCONT on buffer in all cases

Always mark discont on the input buffer when we detect a seqnum
discont and not only when we previously marked ourselves DISCONT.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=706422
This commit is contained in:
Wim Taymans 2013-08-21 12:34:24 +02:00
parent cb3e2fd218
commit 121235511a

View file

@ -267,7 +267,7 @@ gst_rtp_base_depayload_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
GstClockTime pts, dts; GstClockTime pts, dts;
guint16 seqnum; guint16 seqnum;
guint32 rtptime; guint32 rtptime;
gboolean discont; gboolean discont, buf_discont;
gint gap; gint gap;
GstRTPBuffer rtp = { NULL }; GstRTPBuffer rtp = { NULL };
@ -281,8 +281,7 @@ gst_rtp_base_depayload_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
if (G_UNLIKELY (!gst_rtp_buffer_map (in, GST_MAP_READ, &rtp))) if (G_UNLIKELY (!gst_rtp_buffer_map (in, GST_MAP_READ, &rtp)))
goto invalid_buffer; goto invalid_buffer;
if (!priv->discont) buf_discont = GST_BUFFER_IS_DISCONT (in);
priv->discont = GST_BUFFER_IS_DISCONT (in);
pts = GST_BUFFER_PTS (in); pts = GST_BUFFER_PTS (in);
dts = GST_BUFFER_DTS (in); dts = GST_BUFFER_DTS (in);
@ -298,10 +297,10 @@ gst_rtp_base_depayload_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
rtptime = gst_rtp_buffer_get_timestamp (&rtp); rtptime = gst_rtp_buffer_get_timestamp (&rtp);
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
discont = FALSE; discont = buf_discont;
GST_LOG_OBJECT (filter, "discont %d, seqnum %u, rtptime %u, pts %" GST_LOG_OBJECT (filter, "discont %d, seqnum %u, rtptime %u, pts %"
GST_TIME_FORMAT ", dts %" GST_TIME_FORMAT, priv->discont, seqnum, rtptime, GST_TIME_FORMAT ", dts %" GST_TIME_FORMAT, buf_discont, seqnum, rtptime,
GST_TIME_ARGS (pts), GST_TIME_ARGS (dts)); GST_TIME_ARGS (pts), GST_TIME_ARGS (dts));
/* Check seqnum. This is a very simple check that makes sure that the seqnums /* Check seqnum. This is a very simple check that makes sure that the seqnums
@ -335,13 +334,15 @@ gst_rtp_base_depayload_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
} }
priv->next_seqnum = (seqnum + 1) & 0xffff; priv->next_seqnum = (seqnum + 1) & 0xffff;
if (G_UNLIKELY (discont && !priv->discont)) { if (G_UNLIKELY (discont)) {
GST_LOG_OBJECT (filter, "mark DISCONT on input buffer");
/* we detected a seqnum discont but the buffer was not flagged with a discont,
* set the discont flag so that the subclass can throw away old data. */
priv->discont = TRUE; priv->discont = TRUE;
in = gst_buffer_make_writable (in); if (!buf_discont) {
GST_BUFFER_FLAG_SET (in, GST_BUFFER_FLAG_DISCONT); /* we detected a seqnum discont but the buffer was not flagged with a discont,
* set the discont flag so that the subclass can throw away old data. */
GST_LOG_OBJECT (filter, "mark DISCONT on input buffer");
in = gst_buffer_make_writable (in);
GST_BUFFER_FLAG_SET (in, GST_BUFFER_FLAG_DISCONT);
}
} }
bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter); bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);