kopia lustrzana https://gitlab.com/eliggett/wfview
Remove attempt to reduce PA latency
rodzic
a6ea32d996
commit
a0f7d5d86f
|
@ -295,18 +295,11 @@ void paHandler::convertedOutput(audioPacket packet) {
|
||||||
if (packet.data.size() > 0) {
|
if (packet.data.size() > 0) {
|
||||||
|
|
||||||
if (Pa_IsStreamActive(audio) == 1) {
|
if (Pa_IsStreamActive(audio) == 1) {
|
||||||
if (currentLatency < (setup.latency+latencyAllowance)) {
|
|
||||||
PaError err = Pa_WriteStream(audio, (char*)packet.data.data(), packet.data.size() / nativeFormat.bytesPerFrame());
|
PaError err = Pa_WriteStream(audio, (char*)packet.data.data(), packet.data.size() / nativeFormat.bytesPerFrame());
|
||||||
|
|
||||||
if (err != paNoError) {
|
if (err != paNoError) {
|
||||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Error writing audio!";
|
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Error writing audio!";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Discarding audio data as current latency" << currentLatency << "exceeds setup latency" << setup.latency;
|
|
||||||
Pa_StopStream(audio);
|
|
||||||
latencyAllowance++;
|
|
||||||
}
|
|
||||||
const PaStreamInfo* info = Pa_GetStreamInfo(audio);
|
const PaStreamInfo* info = Pa_GetStreamInfo(audio);
|
||||||
currentLatency = packet.time.msecsTo(QTime::currentTime()) + (info->outputLatency * 1000);
|
currentLatency = packet.time.msecsTo(QTime::currentTime()) + (info->outputLatency * 1000);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue