Răsfoiți Sursa

obs-x264: Don't show buffer size if buffer size off

Whether buffer size is visible is determined by the value of the "Use
buffer size" property (the "use_bufsize" setting).

(Commit edited and formatted by Jim: separated this code from the
previous commit, and gave it a proper commit message)

Closes jp9000/obs-studio#567
SuslikV 9 ani în urmă
părinte
comite
2d2ca06f6d
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      plugins/obs-x264/obs-x264.c

+ 2 - 1
plugins/obs-x264/obs-x264.c

@@ -142,6 +142,7 @@ static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
 		obs_data_t *settings)
 {
 	const char *rc = obs_data_get_string(settings, "rate_control");
+	bool use_bufsize = obs_data_get_bool(settings, "use_bufsize");
 	bool abr = astrcmpi(rc, "CBR") == 0 || astrcmpi(rc, "ABR") == 0;
 	bool rc_crf = astrcmpi(rc, "CRF") == 0;
 
@@ -153,7 +154,7 @@ static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
 	p = obs_properties_get(ppts, "use_bufsize");
 	obs_property_set_visible(p, !rc_crf);
 	p = obs_properties_get(ppts, "buffer_size");
-	obs_property_set_visible(p, !rc_crf);
+	obs_property_set_visible(p, !rc_crf && use_bufsize);
 	return true;
 }