mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix audio calls on Windows
This commit is contained in:
parent
06d3f7fe34
commit
1e88fb519b
9
core.cpp
9
core.cpp
|
@ -1059,6 +1059,11 @@ void Core::prepareCall(int friendId, int callId, ToxAv* toxav)
|
|||
{
|
||||
calls[callId].audioOutput = new QAudioOutput(format);
|
||||
calls[callId].audioOutput->start(&calls[callId].audioBuffer);
|
||||
int error = calls[callId].audioOutput->error();
|
||||
if (error != QAudio::NoError)
|
||||
{
|
||||
qWarning() << QString("Core: Error %1 when starting audio output").arg(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Start input
|
||||
|
@ -1119,12 +1124,14 @@ void Core::playCallAudio(int callId, ToxAv* toxav)
|
|||
continue;
|
||||
}
|
||||
//qDebug() << QString("Core: Received %1 bytes, %2 audio bytes free, %3 core buffer size")
|
||||
//.arg(len*2).arg(calls[callId].audioOutput->bytesFree()).arg(calls[callId].audioBuffer.bufferSize());
|
||||
// .arg(len*2).arg(calls[callId].audioOutput->bytesFree()).arg(calls[callId].audioBuffer.bufferSize());
|
||||
calls[callId].audioBuffer.writeData((char*)buf, len*2);
|
||||
int state = calls[callId].audioOutput->state();
|
||||
if (state != QAudio::ActiveState)
|
||||
{
|
||||
qDebug() << QString("Core: Audio state is %1").arg(state);
|
||||
if (state == 3)
|
||||
calls[callId].audioOutput->start(&calls[callId].audioBuffer);
|
||||
}
|
||||
int error = calls[callId].audioOutput->error();
|
||||
if (error != QAudio::NoError)
|
||||
|
|
2
main.cpp
2
main.cpp
|
@ -19,6 +19,8 @@ int main(int argc, char *argv[])
|
|||
/** TODO
|
||||
* ">using a dedicated tool to maintain a TODO list" edition
|
||||
*
|
||||
* Sending large files (~380MB) "restarts" after ~10MB. Goes back to 0%, consumes twice as much ram (reloads the file?)
|
||||
* => Don't load the whole file at once, load small chunks (25MB?) when needed, then free them and load the next
|
||||
* Notifications/ringing when a call is received
|
||||
* Sort the friend list by status, online first then busy then offline
|
||||
* Don't do anything if a friend is disconnected, don't print to the chat
|
||||
|
|
Loading…
Reference in New Issue
Block a user