x265enc: add negative DTS support
authorMathieu Duponchelle <mathieu@centricular.com>
Fri, 18 Jun 2021 17:26:35 +0000 (19:26 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 21 Jun 2021 10:31:21 +0000 (10:31 +0000)
Use the same set_min_pts approach as x264enc.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/304
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2340>

ext/x265/gstx265enc.c

index eb6552d..148a195 100644 (file)
@@ -643,6 +643,10 @@ gst_x265_enc_start (GstVideoEncoder * encoder)
 
   g_ptr_array_set_size (x265enc->peer_profiles, 0);
 
+  /* make sure that we have enough time for first DTS,
+     this is probably overkill for most streams */
+  gst_video_encoder_set_min_pts (encoder, GST_SECOND * 60 * 60 * 1000);
+
   return TRUE;
 }