From 3621b82c632525dcb2c472d66989ea4dfe447212 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 25 Jul 2024 03:03:41 +0530 Subject: [PATCH] vtenc: Fix setting of quality property gst_vtenc_set_quality() will never actually set the VT compression property, because it tries to set it on self->session which is not initialized at this point. Part-of: --- subprojects/gst-plugins-bad/sys/applemedia/vtenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c b/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c index 95bd75fc8a..86ec454266 100644 --- a/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c +++ b/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c @@ -615,8 +615,8 @@ gst_vtenc_set_quality (GstVTEnc * self, gdouble quality) { GST_OBJECT_LOCK (self); self->quality = quality; - GST_INFO_OBJECT (self, "setting quality %f", quality); if (self->session != NULL) { + GST_INFO_OBJECT (self, "setting quality %f", quality); gst_vtenc_session_configure_property_double (self, self->session, kVTCompressionPropertyKey_Quality, quality); } @@ -1588,7 +1588,8 @@ gst_vtenc_create_session (GstVTEnc * self) gst_vtenc_get_realtime (self)); gst_vtenc_session_configure_allow_frame_reordering (self, session, gst_vtenc_get_allow_frame_reordering (self)); - gst_vtenc_set_quality (self, self->quality); + gst_vtenc_session_configure_property_double (self, session, + kVTCompressionPropertyKey_Quality, self->quality); if (self->dump_properties) { gst_vtenc_session_dump_properties (self, session);