Skip to content
Snippets Groups Projects
Commit 2dcb9e7c authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Add a timer to the alsa thread to not jam the CPU load

parent d6b192f6
Branches
Tags
No related merge requests found
......@@ -82,7 +82,7 @@ void
AudioRtp::closeRtpSession () {
ost::MutexLock m(_threadMutex);
// This will make RTP threads finish.
// _debug("Stopping AudioRTP\n");
_debug("Stopping AudioRTP\n");
try {
delete _RTXThread; _RTXThread = 0;
} catch(...) {
......@@ -388,7 +388,6 @@ AudioRtpRTX::run () {
initBuffers();
int step;
try {
// Init the session
initAudioRtpSession();
step = (int) (_layerFrameSize * _codecSampleRate / 1000);
......@@ -425,15 +424,9 @@ AudioRtpRTX::run () {
}
//_debug("stop stream for audiortp loop\n");
audiolayer->stopStream();
} catch(std::exception &e) {
_start.post();
_debug("! ARTP: Stop %s\n", e.what());
throw;
} catch(...) {
_start.post();
_debugException("* ARTP Action: Stop");
throw;
}
_debug("- ARTP Action: Stop\n");
}
......
......@@ -54,6 +54,7 @@ void AudioThread::run (void)
{
while(!testCancel()) {
_alsa->audioCallback();
Thread::sleep(3);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment