From 42ff6423728b4453aa8761e0753471a255421c3b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 20 May 2014 13:58:20 +0200 Subject: [PATCH] gstrtpmp4gpay: propagate the GST_BUFFER_FLAG_DISCONT flag Propagate the DISCONT flag to the first RTP packet being used to transfer a DISCONT buffer. https://bugzilla.gnome.org/show_bug.cgi?id=730563 --- gst/rtp/gstrtpmp4gpay.c | 7 +++++++ gst/rtp/gstrtpmp4gpay.h | 1 + 2 files changed, 8 insertions(+) diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c index 7913d9aba3..e374e5cd7c 100644 --- a/gst/rtp/gstrtpmp4gpay.c +++ b/gst/rtp/gstrtpmp4gpay.c @@ -543,6 +543,12 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay) rtpmp4gpay->offset += rtpmp4gpay->frame_len; } + if (rtpmp4gpay->discont) { + GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT); + /* Only the first outputted buffer has the DISCONT flag */ + rtpmp4gpay->discont = FALSE; + } + ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmp4gpay), outbuf); avail -= payload_len; @@ -563,6 +569,7 @@ gst_rtp_mp4g_pay_handle_buffer (GstRTPBasePayload * basepayload, rtpmp4gpay->first_timestamp = GST_BUFFER_TIMESTAMP (buffer); rtpmp4gpay->first_duration = GST_BUFFER_DURATION (buffer); + rtpmp4gpay->discont = GST_BUFFER_IS_DISCONT (buffer); /* we always encode and flush a full AU */ gst_adapter_push (rtpmp4gpay->adapter, buffer); diff --git a/gst/rtp/gstrtpmp4gpay.h b/gst/rtp/gstrtpmp4gpay.h index fed9c930b5..7506fad96d 100644 --- a/gst/rtp/gstrtpmp4gpay.h +++ b/gst/rtp/gstrtpmp4gpay.h @@ -47,6 +47,7 @@ struct _GstRtpMP4GPay GstAdapter *adapter; GstClockTime first_timestamp; GstClockTime first_duration; + gboolean discont; GstClockTime duration; guint64 offset;