From 19617f7edbbc0d709508045770877a85d586ab9a Mon Sep 17 00:00:00 2001 From: Pengfei Zhu Date: Tue, 21 Sep 2021 01:10:36 +0800 Subject: [PATCH] dsp_interface: Move sink to the last in member list (#5844) So that it is destructed first. Otherwise, the TimeStretcher will be destructed before the Sink, which might cause segfaults when the Sink tries to read data from the TimeStretcher afterwards. --- src/audio_core/dsp_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio_core/dsp_interface.h b/src/audio_core/dsp_interface.h index 41ab0c0dc..066499a41 100644 --- a/src/audio_core/dsp_interface.h +++ b/src/audio_core/dsp_interface.h @@ -108,12 +108,12 @@ private: void FlushResidualStretcherAudio(); void OutputCallback(s16* buffer, std::size_t num_frames); - std::unique_ptr sink; std::atomic perform_time_stretching = false; std::atomic flushing_time_stretcher = false; Common::RingBuffer fifo; std::array last_frame{}; TimeStretcher time_stretcher; + std::unique_ptr sink; template void serialize(Archive& ar, const unsigned int) {}