47 lines
2.1 KiB
Diff
47 lines
2.1 KiB
Diff
From ce6b7033cd4d546040eeb3851f8e2d00fac87048 Mon Sep 17 00:00:00 2001
|
|
From: peijiankang <peijiankang@kylinos.cn>
|
|
Date: Thu, 12 Jan 2023 15:09:23 +0800
|
|
Subject: [PATCH] fix ukui-volume-control-applet-qt work error
|
|
|
|
---
|
|
ukui-volume-control-applet-qt/ukmedia_main_widget.cpp | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/ukui-volume-control-applet-qt/ukmedia_main_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_main_widget.cpp
|
|
index a6dd72d..a57919a 100644
|
|
--- a/ukui-volume-control-applet-qt/ukmedia_main_widget.cpp
|
|
+++ b/ukui-volume-control-applet-qt/ukmedia_main_widget.cpp
|
|
@@ -3203,8 +3203,8 @@ void UkmediaMainWidget::switchModuleEchoCancel()
|
|
if ( strstr(m_pVolumeControl->defaultSourceName,"alsa_input") && !strstr(m_pVolumeControl->defaultSourceName,"input.usb")) {
|
|
sourceState = true;
|
|
}
|
|
- qDebug() << "switchModuleEchoCancel" << m_pVolumeControl->defaultSourceName << switchState << sourceState;
|
|
- if (switchState && sourceState && !isLoadEchoCancel && !strstr(m_pVolumeControl->defaultSourceName,"noiseReduceSource")) {
|
|
+ qDebug() << "switchModuleEchoCancel" << "loadechocancel"<< isLoadEchoCancel << m_pVolumeControl->defaultSourceName << switchState << sourceState;
|
|
+ if (switchState && sourceState) {
|
|
pa_operation *o;
|
|
qDebug() << "load module echo cancel";
|
|
isLoadEchoCancel = true;
|
|
@@ -3212,7 +3212,7 @@ void UkmediaMainWidget::switchModuleEchoCancel()
|
|
m_pVolumeControl->showError(QObject::tr("pa_context_load_module() failed").toUtf8().constData());
|
|
}
|
|
}
|
|
- else {
|
|
+ else if (strstr(m_pVolumeControl->defaultSourceName,"noiseReduceSource") && !switchState) {
|
|
isLoadEchoCancel = false;
|
|
m_pVolumeControl->getModuleIndexByName("module-echo-cancel");
|
|
|
|
@@ -3221,6 +3221,9 @@ void UkmediaMainWidget::switchModuleEchoCancel()
|
|
pa_context_unload_module(m_pVolumeControl->getContext(),m_pVolumeControl->findModuleIndex,nullptr,nullptr);
|
|
});
|
|
}
|
|
+ else {
|
|
+ isLoadEchoCancel = false;
|
|
+ }
|
|
}
|
|
|
|
UkmediaMainWidget::~UkmediaMainWidget()
|
|
--
|
|
2.33.0
|
|
|