diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2018-12-12 15:25:45 +0100 |
---|---|---|
committer | Mathieu Duponchelle <mduponchelle1@gmail.com> | 2019-04-05 00:28:48 +0000 |
commit | f11ce297f4db80533d7bd5559d9649fa54002ace (patch) | |
tree | 2d170dd6c42470c23eadcb2bdf8e06afffcfbeb9 | |
parent | 62b240eb4e1561c677088a5c1fe53075d0ef7a20 (diff) | |
download | gstreamer-plugins-bad-f11ce297f4db80533d7bd5559d9649fa54002ace.tar.gz |
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
-rw-r--r-- | gst/onvif/gstrtponviftimestamp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/onvif/gstrtponviftimestamp.c b/gst/onvif/gstrtponviftimestamp.c index 08d4a3c54..8c77b0052 100644 --- a/gst/onvif/gstrtponviftimestamp.c +++ b/gst/onvif/gstrtponviftimestamp.c @@ -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"); |