- fix crash in VPN networks + fix build for softphone clients

This commit is contained in:
2026-06-10 09:46:28 +03:00
parent c1ab8778bc
commit 2c89b80dcd
2 changed files with 25 additions and 2 deletions
+15 -1
View File
@@ -34,7 +34,21 @@ void SingleAudioStream::copyPcmTo(Audio::DataWindow& output, int needed)
// Packet by packet
while (output.filled() < needed)
{
if (mReceiver.getAudioTo(output, {}).mStatus != AudioReceiver::DecodeResult::Status::Ok)
// Number of bytes to fill on this step
auto requested = needed - output.filled();
auto options = AudioReceiver::DecodeOptions{
.mRealtimeProcessing = true,
.mResampleToMainRate = true,
.mSkipDecode = false,
.mElapsed = std::chrono::milliseconds(requested / (AUDIO_SAMPLERATE / 1000))
};
// Try to get the data from receiver / decoder
if (options.mElapsed != 0ms) {
if (mReceiver.getAudioTo(output, options).mStatus != AudioReceiver::DecodeResult::Status::Ok)
break;
} else
break;
}