mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-22 15:42:48 +00:00
audio_core: Dispose of current audio sink before opening new one. (#6567)
This commit is contained in:
parent
72b82ef6ed
commit
848116b5be
|
@ -17,6 +17,9 @@ DspInterface::DspInterface() = default;
|
|||
DspInterface::~DspInterface() = default;
|
||||
|
||||
void DspInterface::SetSink(AudioCore::SinkType sink_type, std::string_view audio_device) {
|
||||
// Dispose of the current sink first to avoid contention.
|
||||
sink.reset();
|
||||
|
||||
sink = CreateSinkFromID(sink_type, audio_device);
|
||||
sink->SetCallback(
|
||||
[this](s16* buffer, std::size_t num_frames) { OutputCallback(buffer, num_frames); });
|
||||
|
|
Loading…
Reference in a new issue