mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
gstsmartencoder: don't make calculations for invalid DTS
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>
This commit is contained in:
parent
62c303c2e0
commit
b2c4052531
1 changed files with 4 additions and 1 deletions
|
@ -91,9 +91,12 @@ translate_timestamp_from_internal_to_src (GstSmartEncoder * self,
|
|||
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. */
|
||||
|
|
Loading…
Reference in a new issue