Bug Fix: Restart converter on format change

The converter doesn't just require an output format call, it also
requires this input format change callback to actually signal it to
reopen the converter process with a new format setup.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-03-07 05:38:59 -08:00
parent 780d9ae759
commit 267948350a

View file

@ -273,6 +273,9 @@
} }
if(inputNode) { if(inputNode) {
AudioStreamBasicDescription inputFormat = [inputNode nodeFormat]; AudioStreamBasicDescription inputFormat = [inputNode nodeFormat];
if(converter) {
[converter inputFormatDidChange:inputFormat inputConfig:[inputNode nodeChannelConfig]];
}
[inputNode seek:(long)(amountPlayed * inputFormat.mSampleRate)]; [inputNode seek:(long)(amountPlayed * inputFormat.mSampleRate)];
} }
} }