Projects
home:Eustace:branches:Eulaceura:Factory
ukui-media
_service:obs_scm:0003-fix-coredump-of-ukui-volu...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0003-fix-coredump-of-ukui-volume-control-applet-qt.patch of Package ukui-media
From 31d9527ddb1f1e1c009378c867e862cb7aaa68c0 Mon Sep 17 00:00:00 2001 From: peijiankang <peijiankang@kylinos.cn> Date: Wed, 15 Feb 2023 16:26:38 +0800 Subject: [PATCH] fix coredump of ukui-volume-control-applet-qt --- .../ukmedia_volume_control.cpp | 16 ++++++++++++++++ .../ukmedia_volume_control.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ukui-volume-control-applet-qt/ukmedia_volume_control.cpp b/ukui-volume-control-applet-qt/ukmedia_volume_control.cpp index b07294d..8edc83f 100644 --- a/ukui-volume-control-applet-qt/ukmedia_volume_control.cpp +++ b/ukui-volume-control-applet-qt/ukmedia_volume_control.cpp @@ -103,6 +103,10 @@ void UkmediaVolumeControl::setSinkMute(bool status) */ void UkmediaVolumeControl::setSinkVolume(int index,int value) { + if(m_pDefaultSink == nullptr){ + return; + } + pa_cvolume v = m_pDefaultSink->volume; v.channels = channel; for (int i=0;i<v.channels;i++) @@ -141,6 +145,10 @@ void UkmediaVolumeControl::setSourceMute(bool status) */ void UkmediaVolumeControl::setSourceVolume(int index,int value) { + if(m_pDefaultSink == nullptr){ + return; + } + pa_cvolume v = m_pDefaultSink->volume; v.channels = inputChannel; for (int i=0;i<v.channels;i++) @@ -231,6 +239,10 @@ int UkmediaVolumeControl::getModuleIndexByName(QString name) */ void UkmediaVolumeControl::setSinkInputVolume(int index, int value,int channel) { + if(m_pDefaultSink == nullptr){ + return; + } + pa_cvolume v = m_pDefaultSink->volume; v.channels = channel; @@ -267,6 +279,10 @@ void UkmediaVolumeControl::setSinkInputMuted(int index, bool status) */ void UkmediaVolumeControl::setSourceOutputVolume(int index, int value) { + if(m_pDefaultSink == nullptr){ + return; + } + pa_cvolume v = m_pDefaultSink->volume; v.channels = sourceOutputChannel; for (int i=0;i<v.channels;i++) diff --git a/ukui-volume-control-applet-qt/ukmedia_volume_control.h b/ukui-volume-control-applet-qt/ukmedia_volume_control.h index 555825f..b39b248 100644 --- a/ukui-volume-control-applet-qt/ukmedia_volume_control.h +++ b/ukui-volume-control-applet-qt/ukmedia_volume_control.h @@ -167,7 +167,7 @@ public: bool firstRun = true; pa_cvolume m_defaultSinkVolume; - const pa_sink_info *m_pDefaultSink; + const pa_sink_info *m_pDefaultSink = nullptr; pa_context* m_pPaContext; std::map<uint32_t, char*> clientNames; SinkInputType showSinkInputType; -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2