mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-02 05:18:55 -05:00
UI: Cleanup libobs C++ type use
This commit is contained in:
@@ -1828,7 +1828,7 @@ OBSPropertiesView *
|
||||
OBSBasicSettings::CreateEncoderPropertyView(const char *encoder,
|
||||
const char *path, bool changed)
|
||||
{
|
||||
obs_data_t *settings = obs_encoder_defaults(encoder);
|
||||
OBSDataAutoRelease settings = obs_encoder_defaults(encoder);
|
||||
OBSPropertiesView *view;
|
||||
|
||||
if (path) {
|
||||
@@ -1844,13 +1844,12 @@ OBSBasicSettings::CreateEncoderPropertyView(const char *encoder,
|
||||
}
|
||||
|
||||
view = new OBSPropertiesView(
|
||||
settings, encoder,
|
||||
settings.Get(), encoder,
|
||||
(PropertiesReloadCallback)obs_get_encoder_properties, 170);
|
||||
view->setFrameShape(QFrame::StyledPanel);
|
||||
view->setProperty("changed", QVariant(changed));
|
||||
QObject::connect(view, SIGNAL(Changed()), this, SLOT(OutputsChanged()));
|
||||
|
||||
obs_data_release(settings);
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -2210,9 +2209,9 @@ void OBSBasicSettings::LoadListValues(QComboBox *widget, obs_property_t *prop,
|
||||
{
|
||||
size_t count = obs_property_list_item_count(prop);
|
||||
|
||||
obs_source_t *source = obs_get_output_source(index);
|
||||
OBSSourceAutoRelease source = obs_get_output_source(index);
|
||||
const char *deviceId = nullptr;
|
||||
obs_data_t *settings = nullptr;
|
||||
OBSDataAutoRelease settings = nullptr;
|
||||
|
||||
if (source) {
|
||||
settings = obs_source_get_settings(source);
|
||||
@@ -2243,11 +2242,6 @@ void OBSBasicSettings::LoadListValues(QComboBox *widget, obs_property_t *prop,
|
||||
"errorLabel");
|
||||
}
|
||||
}
|
||||
|
||||
if (settings)
|
||||
obs_data_release(settings);
|
||||
if (source)
|
||||
obs_source_release(source);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAudioDevices()
|
||||
@@ -3715,13 +3709,11 @@ void OBSBasicSettings::SaveHotkeySettings()
|
||||
if (!hotkey.first)
|
||||
continue;
|
||||
|
||||
obs_data_array_t *array = obs_hotkey_save(hw.id);
|
||||
obs_data_t *data = obs_data_create();
|
||||
OBSDataArrayAutoRelease array = obs_hotkey_save(hw.id);
|
||||
OBSDataAutoRelease data = obs_data_create();
|
||||
obs_data_set_array(data, "bindings", array);
|
||||
const char *json = obs_data_get_json(data);
|
||||
config_set_string(config, "Hotkeys", hw.name.c_str(), json);
|
||||
obs_data_release(data);
|
||||
obs_data_array_release(array);
|
||||
}
|
||||
|
||||
if (!main->outputHandler || !main->outputHandler->replayBuffer)
|
||||
@@ -3729,11 +3721,10 @@ void OBSBasicSettings::SaveHotkeySettings()
|
||||
|
||||
const char *id = obs_obj_get_id(main->outputHandler->replayBuffer);
|
||||
if (strcmp(id, "replay_buffer") == 0) {
|
||||
obs_data_t *hotkeys = obs_hotkeys_save_output(
|
||||
OBSDataAutoRelease hotkeys = obs_hotkeys_save_output(
|
||||
main->outputHandler->replayBuffer);
|
||||
config_set_string(config, "Hotkeys", "ReplayBuffer",
|
||||
obs_data_get_json(hotkeys));
|
||||
obs_data_release(hotkeys);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4785,10 +4776,10 @@ void OBSBasicSettings::AdvReplayBufferChanged()
|
||||
sizeof(encoderJsonPath),
|
||||
"recordEncoder.json");
|
||||
if (ret > 0) {
|
||||
obs_data_t *data = obs_data_create_from_json_file_safe(
|
||||
encoderJsonPath, "bak");
|
||||
OBSDataAutoRelease data =
|
||||
obs_data_create_from_json_file_safe(
|
||||
encoderJsonPath, "bak");
|
||||
obs_data_apply(settings, data);
|
||||
obs_data_release(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4858,8 +4849,8 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
|
||||
delete simpleOutRecWarning;
|
||||
|
||||
if (enforceBitrate && service) {
|
||||
obs_data_t *videoSettings = obs_data_create();
|
||||
obs_data_t *audioSettings = obs_data_create();
|
||||
OBSDataAutoRelease videoSettings = obs_data_create();
|
||||
OBSDataAutoRelease audioSettings = obs_data_create();
|
||||
int oldVBitrate = ui->simpleOutputVBitrate->value();
|
||||
int oldABitrate =
|
||||
ui->simpleOutputABitrate->currentText().toInt();
|
||||
@@ -4881,9 +4872,6 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
|
||||
warning += SIMPLE_OUTPUT_WARNING("AudioBitrate")
|
||||
.arg(newABitrate);
|
||||
}
|
||||
|
||||
obs_data_release(videoSettings);
|
||||
obs_data_release(audioSettings);
|
||||
}
|
||||
|
||||
if (qual == "Lossless") {
|
||||
|
||||
Reference in New Issue
Block a user