From 8c4aa7067d038b7932c83ad3b7d01bc784891bf1 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 19 Apr 2024 00:14:15 +0800 Subject: [PATCH] vaav1enc: Do not change the PTS/DTS of output frames The AV1 encoder does not reorder the frames, so there is no need to change the timestamp related meta data of output frames, just inheriting it from the input frames. Part-of: --- .../gst-plugins-bad/sys/va/gstvaav1enc.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaav1enc.c b/subprojects/gst-plugins-bad/sys/va/gstvaav1enc.c index cac340a9cb..5c1b560088 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaav1enc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaav1enc.c @@ -4012,23 +4012,6 @@ gst_va_av1_enc_prepare_output (GstVaBaseEnc * base, return TRUE; } - if (frame_enc->flags & FRAME_FLAG_NOT_SHOW && - ((frame_enc->type & FRAME_TYPE_REPEAT) == 0)) { - frame->pts = self->last_pts; - frame->dts = self->last_dts; - frame->duration = GST_CLOCK_TIME_NONE; - } else { - frame->pts = - base->start_pts + base->frame_duration * frame_enc->total_frame_count; - /* The PTS should always be later than the DTS. */ - frame->dts = frame->pts - base->frame_duration; - base->output_frame_count++; - frame->duration = base->frame_duration; - - self->last_pts = frame->pts; - self->last_dts = frame->dts; - } - if (frame_enc->flags & FRAME_FLAG_ALREADY_OUTPUTTED) { gsize sz; @@ -4071,6 +4054,7 @@ gst_va_av1_enc_prepare_output (GstVaBaseEnc * base, } *complete = TRUE; + base->output_frame_count++; gst_buffer_replace (&frame->output_buffer, buf); gst_clear_buffer (&buf);