gstreamer: Fix output state reference leak

This commit is contained in:
Sebastian Dröge 2023-01-11 15:19:04 +02:00 committed by Hassene Tmar
parent b498bdb765
commit d9efa54783

View file

@ -725,6 +725,7 @@ gst_svtav1enc_set_format (GstVideoEncoder * encoder,
GstSvtAv1Enc *svtav1enc = GST_SVTAV1ENC (encoder);
GstClockTime min_latency_frames = 0;
GstCaps *src_caps = NULL;
GstVideoCodecState *output_state;
GST_DEBUG_OBJECT (svtav1enc, "set_format");
if (svtav1enc->state)
@ -750,9 +751,10 @@ gst_svtav1enc_set_format (GstVideoEncoder * encoder,
src_caps =
gst_static_pad_template_get_caps (&gst_svtav1enc_src_pad_template);
gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (encoder), src_caps,
output_state = gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (encoder), src_caps,
svtav1enc->state);
gst_caps_unref (src_caps);
gst_video_codec_state_unref (output_state);
GST_DEBUG_OBJECT (svtav1enc, "output caps: %" GST_PTR_FORMAT,
svtav1enc->state->caps);