Commit f65c8fff authored by Mathieu Duponchelle's avatar Mathieu Duponchelle 🐸 Committed by Mathieu Duponchelle

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.
parent 0d5db929
Pipeline #49788 passed with stages
in 31 minutes and 34 seconds
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment