mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Stop trying to play audio in dead calls
This commit is contained in:
parent
f5a628fafb
commit
104b874cb5
6
core.cpp
6
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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user