From 56f3af3b96ec070eee58a0869ffd7c06230395f9 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 21 Mar 2021 14:58:18 -0700 Subject: [PATCH] Guard against null debug during shutdown. --- script/install-deps.sh | 3 +++ src/plugins/pipewireout/PipeWireOut.cpp | 4 ++-- src/plugins/pipewireout/PipeWireOut.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/script/install-deps.sh b/script/install-deps.sh index 9fdd16d1e..9290bc99c 100755 --- a/script/install-deps.sh +++ b/script/install-deps.sh @@ -6,6 +6,9 @@ if [ $OS == "Linux" ]; then DISTRO=`lsb_release -cs` echo "detected ${DISTRO}" case $DISTRO in + "hirsute") + sudo apt-get install build-essential clang cmake libboost-thread1.71-dev libboost-system1.71-dev libboost-filesystem1.71-dev libboost-date-time1.71-dev libboost-atomic1.71-dev libboost-chrono1.71-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncurses-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev libavcodec-extra libopenmpt-dev libssl-dev libspa-0.2-dev libpipewire-0.3-dev pipewire pipewire-bin pipewire-audio-client-libraries + ;; "focal" | "groovy") sudo apt-get install build-essential clang cmake libboost-thread1.71-dev libboost-system1.71-dev libboost-filesystem1.71-dev libboost-date-time1.71-dev libboost-atomic1.71-dev libboost-chrono1.71-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncurses-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev libavcodec-extra libopenmpt-dev libssl-dev ;; diff --git a/src/plugins/pipewireout/PipeWireOut.cpp b/src/plugins/pipewireout/PipeWireOut.cpp index b4f20e89e..3eedd302c 100644 --- a/src/plugins/pipewireout/PipeWireOut.cpp +++ b/src/plugins/pipewireout/PipeWireOut.cpp @@ -289,7 +289,7 @@ IDevice* PipeWireOut::GetDefaultDevice() { } void PipeWireOut::StopPipeWire() { - ::debug->Info(TAG, "shutdown started"); + if (::debug) ::debug->Info(TAG, "shutdown started"); this->Stop(); @@ -317,7 +317,7 @@ void PipeWireOut::StopPipeWire() { this->channelCount = 0; this->sampleRate = 0; - ::debug->Info(TAG, "shutdown complete"); + if (::debug) ::debug->Info(TAG, "shutdown complete"); } bool PipeWireOut::StartPipeWire(IBuffer* buffer) { diff --git a/src/plugins/pipewireout/PipeWireOut.h b/src/plugins/pipewireout/PipeWireOut.h index b59caefbe..0f474f6a1 100644 --- a/src/plugins/pipewireout/PipeWireOut.h +++ b/src/plugins/pipewireout/PipeWireOut.h @@ -288,7 +288,7 @@ class PipeWireOut : public IOutput { std::condition_variable_any bufferCondition, drainCondition; double volume{1.0}; pw_stream_events pwStreamEvents; - pw_thread_loop* pwThreadLoop {nullptr}; + pw_thread_loop* pwThreadLoop{nullptr}; pw_stream* pwStream{nullptr}; OutBufferContext outBufferContext; long channelCount{0};