diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 223a719e..8d5d1fda 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -8618,13 +8618,13 @@ void OBSBasic::on_agoraPKButton_clicked() } ui->agoraPKButton->setText( - QTStr("Basic.Main.StartAgoraStreaming")); + QTStr("Basic.Main.StopAgoraStreaming")); SetControlWhenPK(true); MuteAudioDevice(true); if (!agoraOutputHandler->StartAgora(agoraService)) { SetControlWhenPK(false); ui->agoraPKButton->setText( - QTStr("Basic.Main.StopAgoraStreaming")); + QTStr("Basic.Main.StartAgoraStreaming")); } //for test @@ -8867,7 +8867,7 @@ void OBSBasic::OnInitRtcEngineFailed(long long code) OBSMessageBox::information(this, QString("Agora"), QString("Init Agora Engine Failed")); } - SetControlWhenPK(false); + //SetPreviewPK(false); } @@ -9123,4 +9123,7 @@ void OBSBasic::OnTokenPrivilegeWillExpire() obs_service_update(agoraService, settings); } -void OBSBasic::OnError(int err, const char *msg) {} +void OBSBasic::OnError(int err, const char *msg) +{ + blog(LOG_ERROR, "Agora initialize ret error, err:%d, msg:%s", err, msg); +} diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index c2c4bcae..39fd386a 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -148,7 +148,7 @@ class ColorSelect : public QWidget { std::unique_ptr ui; }; -class OBSBasic : public OBSMainWindow { +class OBSBasic : public OBSMainWindow { Q_OBJECT Q_PROPERTY(QIcon imageIcon READ GetImageIcon WRITE SetImageIcon DESIGNABLE true) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index abcacafa..c5e70686 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -4920,6 +4920,7 @@ void OBSBasicSettings::SaveAgoraSettings() { AgoraSettings settings; QString strAppid = ui->lineEditAppid->text().toUtf8(); + strAppid = strAppid.trimmed(); if (!strAppid.isEmpty()) settings.appid = strAppid.toUtf8(); settings.appCerf = ui->lineEditToken->text().toUtf8(); diff --git a/plugins/win-agora/Agora/agorartcengine.cpp b/plugins/win-agora/Agora/agorartcengine.cpp index 96fa9692..6512b9e5 100644 --- a/plugins/win-agora/Agora/agorartcengine.cpp +++ b/plugins/win-agora/Agora/agorartcengine.cpp @@ -241,6 +241,7 @@ bool AgoraRtcEngine::InitEngine(std::string appid) signal_handler_signal( obs_service_get_signal_handler(agoraService), "initRtcEngineFailed", ¶ms); + blog(LOG_ERROR, "Agora initialize ret, appid: %s, error: %d", appid.c_str(), ret); return false; } diff --git a/plugins/win-agora/agora-service.cpp b/plugins/win-agora/agora-service.cpp index 8205054e..303bc09f 100644 --- a/plugins/win-agora/agora-service.cpp +++ b/plugins/win-agora/agora-service.cpp @@ -170,9 +170,7 @@ bool AgoraService_Initialize(void *data, obs_output_t *output) AgoraRtcEngine *agora_engine = AgoraRtcEngine::GetInstance(); if (!agora_engine->bInit) { - if (!agora_engine->InitEngine( - service_data - ->agora_appid)) // init agora engine failed + if (!agora_engine->InitEngine(service_data->agora_appid)) // init agora engine failed return false; agora_engine->bInit = true; }