فهرست منبع

UI: Block signals while populating formats

Avoid unnecessarily triggering signals while populating
the ffmpeg formats combo box.
kc5nra 10 سال پیش
والد
کامیت
a090ed5795
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      obs/window-basic-settings.cpp

+ 4 - 0
obs/window-basic-settings.cpp

@@ -416,6 +416,8 @@ void OBSBasicSettings::LoadColorRanges()
 
 
 void OBSBasicSettings::LoadFormats()
 void OBSBasicSettings::LoadFormats()
 {
 {
+	ui->advOutFFFormat->blockSignals(true);
+
 	formats.reset(ff_format_supported());
 	formats.reset(ff_format_supported());
 	const ff_format_desc *format = formats.get();
 	const ff_format_desc *format = formats.get();
 
 
@@ -441,6 +443,8 @@ void OBSBasicSettings::LoadFormats()
 	ui->advOutFFFormat->model()->sort(0);
 	ui->advOutFFFormat->model()->sort(0);
 
 
 	ui->advOutFFFormat->insertItem(0, AV_FORMAT_DEFAULT_STR);
 	ui->advOutFFFormat->insertItem(0, AV_FORMAT_DEFAULT_STR);
+
+	ui->advOutFFFormat->blockSignals(false);
 }
 }
 
 
 static void AddCodec(QComboBox *combo, const ff_codec_desc *codec_desc)
 static void AddCodec(QComboBox *combo, const ff_codec_desc *codec_desc)