From 03d07e8e52fb411d757ed652f5b5f28b1daad7e8 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Tue, 2 Jan 2024 16:18:05 +0100 Subject: [PATCH] vpxenc: fix warning about decreasing PTS on first frame The fields used to track this state should be initialized when codec->inited is FALSE on set_format, not TRUE Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3200 Part-of: --- subprojects/gst-plugins-good/ext/vpx/gstvpxenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/vpx/gstvpxenc.c b/subprojects/gst-plugins-good/ext/vpx/gstvpxenc.c index 2676d89809..4ce7c94a5b 100644 --- a/subprojects/gst-plugins-good/ext/vpx/gstvpxenc.c +++ b/subprojects/gst-plugins-good/ext/vpx/gstvpxenc.c @@ -1743,10 +1743,10 @@ gst_vpx_enc_set_format (GstVideoEncoder * video_encoder, vpx_codec_destroy (&encoder->encoder); encoder->inited = FALSE; encoder->multipass_cache_idx++; - encoder->last_pts = GST_CLOCK_TIME_NONE; - encoder->last_input_duration = GST_CLOCK_TIME_NONE; } else { g_mutex_lock (&encoder->encoder_lock); + encoder->last_pts = GST_CLOCK_TIME_NONE; + encoder->last_input_duration = GST_CLOCK_TIME_NONE; } encoder->cfg.g_bit_depth = encoder->cfg.g_input_bit_depth = info->finfo->bits;