1
0
Эх сурвалжийг харах

rtmp-services: Type check apply_encoder_settings

This fixes ovewritting hidden "profile" setting in ffmpeg vaapi which is
a number and not a string. It also shouldnt be overwritten as it is
required on some AMD hardware for the encoder to work.
Kurt Kartaltepe 6 жил өмнө
parent
commit
d9470770a0

+ 3 - 1
plugins/rtmp-services/rtmp-common.c

@@ -485,7 +485,9 @@ static void apply_video_encoder_settings(obs_data_t *settings,
 	obs_data_set_string(settings, "rate_control", "CBR");
 
 	item = json_object_get(recommended, "profile");
-	if (json_is_string(item)) {
+	obs_data_item_t *enc_item = obs_data_item_byname(settings, "profile");
+	if (json_is_string(item) &&
+	    obs_data_item_gettype(enc_item) == OBS_DATA_STRING) {
 		const char *profile = json_string_value(item);
 		obs_data_set_string(settings, "profile", profile);
 	}