split MainOutputNotActive warning

This commit is contained in:
Exeldro 2024-08-07 12:05:49 +02:00
parent 429ac1a431
commit ab1311ba7c
No known key found for this signature in database
GPG Key ID: 97269A83FC715751
2 changed files with 17 additions and 4 deletions

View File

@ -36,6 +36,7 @@ AudioEncoderSettings="Audio Settings"
# Errors and warnings # Errors and warnings
MainOutputNotActive="Unable to start output. \nThis output is configured to use your main encoder's output (Built-in stream), which is not currently active.\nPlease start your main encoder first." MainOutputNotActive="Unable to start output. \nThis output is configured to use your main encoder's output (Built-in stream), which is not currently active.\nPlease start your main encoder first."
MainOutputEncoderIndexNotFound="Unable to start output. \nThis output is configured to use your main encoder's output (Built-in stream), with an encoder index that does not have an encoder.\nPlease select an encoder index that has an encoder."
NewVersion="New version (%1) available <a href='https://aitum.tv/download/multi/'>here</a>" NewVersion="New version (%1) available <a href='https://aitum.tv/download/multi/'>here</a>"
NoVerticalWarning="<strong>Aitum Vertical is not installed, or is out of date.<br /><a href='https://aitum.tv/download/vertical/'>Click here</a> to download the latest version.</strong>" NoVerticalWarning="<strong>Aitum Vertical is not installed, or is out of date.<br /><a href='https://aitum.tv/download/vertical/'>Click here</a> to download the latest version.</strong>"

View File

@ -824,14 +824,20 @@ bool MultistreamDock::StartOutput(obs_data_t *settings, QPushButton *streamButto
if (!venc_name || venc_name[0] == '\0') { if (!venc_name || venc_name[0] == '\0') {
//use main encoder //use main encoder
auto main_output = obs_frontend_get_streaming_output(); auto main_output = obs_frontend_get_streaming_output();
venc = obs_output_get_video_encoder2(main_output, obs_data_get_int(settings, "video_encoder_index")); if (!obs_output_active(main_output)) {
if (!venc || !obs_output_active(main_output)) {
obs_output_release(main_output); obs_output_release(main_output);
QMessageBox::warning(this, QString::fromUtf8(obs_module_text("MainOutputNotActive")), QMessageBox::warning(this, QString::fromUtf8(obs_module_text("MainOutputNotActive")),
QString::fromUtf8(obs_module_text("MainOutputNotActive"))); QString::fromUtf8(obs_module_text("MainOutputNotActive")));
return false; return false;
} }
auto vei = obs_data_get_int(settings, "video_encoder_index");
venc = obs_output_get_video_encoder2(main_output, vei);
obs_output_release(main_output); obs_output_release(main_output);
if (!venc) {
QMessageBox::warning(this, QString::fromUtf8(obs_module_text("MainOutputEncoderIndexNotFound")),
QString::fromUtf8(obs_module_text("MainOutputEncoderIndexNotFound")));
return false;
}
} else { } else {
obs_data_t *s = nullptr; obs_data_t *s = nullptr;
auto ves = obs_data_get_obj(settings, "video_encoder_settings"); auto ves = obs_data_get_obj(settings, "video_encoder_settings");
@ -860,14 +866,20 @@ bool MultistreamDock::StartOutput(obs_data_t *settings, QPushButton *streamButto
if (!aenc_name || aenc_name[0] == '\0') { if (!aenc_name || aenc_name[0] == '\0') {
//use main encoder //use main encoder
auto main_output = obs_frontend_get_streaming_output(); auto main_output = obs_frontend_get_streaming_output();
aenc = obs_output_get_audio_encoder(main_output, obs_data_get_int(settings, "audio_encoder_index")); if (!obs_output_active(main_output)) {
if (!aenc || !obs_output_active(main_output)) {
obs_output_release(main_output); obs_output_release(main_output);
QMessageBox::warning(this, QString::fromUtf8(obs_module_text("MainOutputNotActive")), QMessageBox::warning(this, QString::fromUtf8(obs_module_text("MainOutputNotActive")),
QString::fromUtf8(obs_module_text("MainOutputNotActive"))); QString::fromUtf8(obs_module_text("MainOutputNotActive")));
return false; return false;
} }
auto aei = obs_data_get_int(settings, "audio_encoder_index");
aenc = obs_output_get_audio_encoder(main_output, aei);
obs_output_release(main_output); obs_output_release(main_output);
if (!aenc) {
QMessageBox::warning(this, QString::fromUtf8(obs_module_text("MainOutputEncoderIndexNotFound")),
QString::fromUtf8(obs_module_text("MainOutputEncoderIndexNotFound")));
return false;
}
} else { } else {
obs_data_t *s = nullptr; obs_data_t *s = nullptr;
auto aes = obs_data_get_obj(settings, "audio_encoder_settings"); auto aes = obs_data_get_obj(settings, "audio_encoder_settings");