From d0d40c7845892a6bde12c4c04e11eae42822058f Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 11 Apr 2023 11:50:57 -0400 Subject: [PATCH] x264enc: Check more video info fields to decide whether to reconfigure encoder The encoder is also initialised using interlace mode, colorimetry, chroma-site and multiview mode, so let's make sure we only skip reinitialising the encoder in set_format() if none of those have changed. Part-of: --- subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c b/subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c index c3757144c0..8d2783fc36 100644 --- a/subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c +++ b/subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c @@ -2332,7 +2332,13 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc, if (info->finfo->format == old->finfo->format && info->width == old->width && info->height == old->height && info->fps_n == old->fps_n && info->fps_d == old->fps_d - && info->par_n == old->par_n && info->par_d == old->par_d) { + && info->par_n == old->par_n && info->par_d == old->par_d + && info->interlace_mode == old->interlace_mode + && gst_video_colorimetry_is_equal (&info->colorimetry, + &old->colorimetry) + && GST_VIDEO_INFO_CHROMA_SITE (info) == GST_VIDEO_INFO_CHROMA_SITE (old) + && GST_VIDEO_INFO_MULTIVIEW_MODE (info) == + GST_VIDEO_INFO_MULTIVIEW_MODE (old)) { gst_video_codec_state_unref (encoder->input_state); encoder->input_state = gst_video_codec_state_ref (state); return TRUE;