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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5876>
This commit is contained in:
Mathieu Duponchelle 2024-01-02 16:18:05 +01:00 committed by GStreamer Marge Bot
parent 5e4e57ddb3
commit 03d07e8e52

View file

@ -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;