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.
This commit is contained in:
Mathieu Duponchelle 2019-07-12 20:24:10 +02:00 committed by Mathieu Duponchelle
parent 0d5db92953
commit f65c8fff50

View file

@ -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;