Instead, as the current code relies on having a valid DTS (for lining
up passed through and re-encoded segments), simply compute a DTS
from the PTS if the DTS was invalid.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1549>
static GstFlowReturn
gst_smart_encoder_finish_buffer (GstSmartEncoder * self, GstBuffer * buf)
{
+ if (!GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS (buf)))
+ GST_BUFFER_DTS (buf) = GST_BUFFER_PTS (buf);
+
translate_timestamp_from_internal_to_src (self, &GST_BUFFER_PTS (buf));
translate_timestamp_from_internal_to_src (self, &GST_BUFFER_DTS (buf));
- GST_BUFFER_DTS (buf) = GST_BUFFER_DTS (buf);
+
if (self->last_dts > GST_BUFFER_DTS (buf)) {
/* Hack to always produces dts increasing DTS-s that are close to what the
* encoder produced. */