1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Cancel sleeping in audio recording

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-07-02 00:17:59 +02:00
parent 85eb3757d6
commit bdeba98f1b

View File

@ -1227,13 +1227,11 @@ void Core::playCallAudio(int callId, ToxAv* toxav)
}
qDebug() << QString("Core::playCallAudio: Error receiving audio: %1").arg(len);
calls[callId].playAudioTimer.start();
calls[callId].audioOutput->start(&calls[callId].audioBuffer);
return;
}
if (len == 0)
{
calls[callId].playAudioTimer.start();
calls[callId].audioOutput->start(&calls[callId].audioBuffer);
return;
}
//qDebug() << QString("Core: Received %1 bytes, %2 audio bytes free, %3 core buffer size")
@ -1243,7 +1241,7 @@ void Core::playCallAudio(int callId, ToxAv* toxav)
if (state != QAudio::ActiveState)
{
qDebug() << QString("Core: Audio state is %1").arg(state);
//if (state == 3 && calls[callId].audioBuffer.bufferSize() >= framesize*2)
if (state == 3 && calls[callId].audioBuffer.bufferSize() >= framesize*2)
calls[callId].audioOutput->start(&calls[callId].audioBuffer);
}
int error = calls[callId].audioOutput->error();
@ -1277,7 +1275,7 @@ void Core::sendCallAudio(int callId, ToxAv* toxav)
calls[callId].sendAudioTimer.start();
return;
}
calls[callId].sendAudioTimer.start(1);
calls[callId].sendAudioTimer.start(0);
}
else
calls[callId].sendAudioTimer.start();