From c02eabcf70e1089cbdcca1444cda6e352fe34f09 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 23 Feb 2025 18:58:44 -0800 Subject: [PATCH] Bug Fix: Fix output volume from seeking Fixes output volume setting on seek or audio output restart on format change. Also safeguards these setters so they don't go off if the nodes aren't actually allocated. Signed-off-by: Christopher Snowhill --- Audio/Chain/BufferChain.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Audio/Chain/BufferChain.m b/Audio/Chain/BufferChain.m index aa4dce9b1..3097332b8 100644 --- a/Audio/Chain/BufferChain.m +++ b/Audio/Chain/BufferChain.m @@ -365,8 +365,15 @@ - (void)setVolume:(double)v { AudioPlayer * audioPlayer = controller; - OutputNode *outputNode = [audioPlayer output]; - [outputNode setVolume:v]; + if(audioPlayer) { + OutputNode *outputNode = [audioPlayer output]; + if(outputNode) { + [outputNode setVolume:v]; + } + } + if(inputNode) { + [inputNode setLastVolume:v]; + } } @end