From e8ef7080347d452019e3b37d998e6cd3d0680771 Mon Sep 17 00:00:00 2001 From: Michael Rogers Date: Mon, 11 Apr 2022 18:09:51 -0500 Subject: [PATCH] Fix virtual sink overriding config sink. --- sunshine/audio.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sunshine/audio.cpp b/sunshine/audio.cpp index 4279eb4c..3cc0e5e0 100644 --- a/sunshine/audio.cpp +++ b/sunshine/audio.cpp @@ -135,9 +135,14 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) { return; } - std::string *sink = - config::audio.sink.empty() ? &ref->sink.host : &config::audio.sink; - if(ref->sink.null) { + // Order of priorty: + // 1. Config + // 2. Virtual if available + // 3. Host + std::string *sink = &ref->sink.host; + if(!config::audio.sink.empty()) { + sink = &config::audio.sink; + } else if(ref->sink.null) { auto &null = *ref->sink.null; switch(stream->channelCount) { case 2: