From 104b874cb57fcd40f7cbaff2953aa127246504e1 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Fri, 27 Jun 2014 19:01:01 +0200 Subject: [PATCH] Stop trying to play audio in dead calls --- core.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core.cpp b/core.cpp index 4e3d60755..a2649d4ab 100644 --- a/core.cpp +++ b/core.cpp @@ -1076,9 +1076,13 @@ void Core::playCallAudio(int callId, ToxAv* toxav) int framesize = (calls[callId].codecSettings.audio_frame_duration * calls[callId].codecSettings.audio_sample_rate) / 1000; uint8_t buf[framesize*2]; int len = toxav_recv_audio(toxav, callId, framesize, (int16_t*)buf); - qDebug() << QString("Core: Received %1 audio bytes").arg(len); if (len < 0) { + if (len == -3) // Not in call ! + { + qWarning("Core: Trying to play audio in an inactive call!"); + return; + } qDebug() << QString("Core::playCallAudio: Error receiving audio: %1").arg(len); QThread::msleep(5); continue;