rtponviftimestamp: prioritize PTS over DTS for NTP timestamp

NTP timestamps are supposed to match the expected presentation
time, prefering the DTS to compute them was incorrect.

<https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf>

Section 6.3.1: NTP Timestamps
This commit is contained in:
Mathieu Duponchelle 2018-12-12 15:25:45 +01:00 committed by Mathieu Duponchelle
parent 62b240eb4e
commit f11ce297f4

View file

@ -518,12 +518,12 @@ handle_buffer (GstRtpOnvifTimestamp * self, GstBuffer * buf)
}
/* NTP timestamp */
if (GST_BUFFER_DTS_IS_VALID (buf)) {
time = gst_segment_to_stream_time (&self->segment, GST_FORMAT_TIME,
GST_BUFFER_DTS (buf));
} else if (GST_BUFFER_PTS_IS_VALID (buf)) {
if (GST_BUFFER_PTS_IS_VALID (buf)) {
time = gst_segment_to_stream_time (&self->segment, GST_FORMAT_TIME,
GST_BUFFER_PTS (buf));
} else if (GST_BUFFER_DTS_IS_VALID (buf)) {
time = gst_segment_to_stream_time (&self->segment, GST_FORMAT_TIME,
GST_BUFFER_DTS (buf));
} else {
GST_INFO_OBJECT (self,
"Buffer doesn't contain any valid DTS or PTS timestamp");