From f65c8fff5016c10e2cb4de6d73d17d02d5216ffb Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 12 Jul 2019 20:24:10 +0200 Subject: [PATCH] rtponviftimestamp: fix setting of the discontinuity flag The D bit is meant to be set whenever there is a discontinuity in transmission, and directly maps to the DISCONT flag. The E bit is not meant to be set on every buffer preceding a discontinuity, but only on the last buffer of a contiguous section of recording. This has to be signaled through the unfortunately-named "discont" field of the custom NtpOffset event. --- gst/onvif/gstrtponviftimestamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/onvif/gstrtponviftimestamp.c b/gst/onvif/gstrtponviftimestamp.c index 8c77b00521..4991e426f9 100644 --- a/gst/onvif/gstrtponviftimestamp.c +++ b/gst/onvif/gstrtponviftimestamp.c @@ -556,7 +556,7 @@ handle_buffer (GstRtpOnvifTimestamp * self, GstBuffer * buf) field |= (1 << 7); } - /* Set E if the next buffer has DISCONT */ + /* Set E if this the last buffer of a contiguous section of recording */ if (self->set_e_bit) { GST_DEBUG_OBJECT (self, "set E flag"); field |= (1 << 6); @@ -564,7 +564,7 @@ handle_buffer (GstRtpOnvifTimestamp * self, GstBuffer * buf) } /* Set D if the buffer has the DISCONT flag */ - if (self->set_d_bit) { + if (self->set_d_bit || GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) { GST_DEBUG_OBJECT (self, "set D flag"); field |= (1 << 5); self->set_d_bit = FALSE;