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

Clean up, indentation, try to handle latency problems in iax/pulseaudio

parent af54afd3
No related branches found
No related tags found
No related merge requests found
...@@ -452,19 +452,8 @@ AudioRtpRTX::run () { ...@@ -452,19 +452,8 @@ AudioRtpRTX::run () {
TimerPort::incTimer(_layerFrameSize); // 'frameSize' ms TimerPort::incTimer(_layerFrameSize); // 'frameSize' ms
} }
// _debug("stop stream for audiortp loop\n");
audiolayer->stopStream(); audiolayer->stopStream();
_debug("- ARTP Action: Stop\n"); _debug("- ARTP Action: Stop\n");
//} catch(std::exception &e) {
//_start.post();
//_debug("! ARTP: Stop %s\n", e.what());
//throw;
//} catch(...) {
//_start.post();
//_debugException("* ARTP Action: Stop");
//throw;
//}
} }
......
...@@ -198,7 +198,7 @@ PulseLayer::getMic(void *buffer, int toCopy) ...@@ -198,7 +198,7 @@ PulseLayer::getMic(void *buffer, int toCopy)
void void
PulseLayer::startStream (void) PulseLayer::startStream (void)
{ {
_micRingBuffer.flush(); flushMic();
_debug("Start stream\n"); _debug("Start stream\n");
pa_threaded_mainloop_lock(m); pa_threaded_mainloop_lock(m);
pa_stream_cork( record->pulseStream(), NULL, NULL, NULL); pa_stream_cork( record->pulseStream(), NULL, NULL, NULL);
......
...@@ -429,7 +429,6 @@ IAXVoIPLink::answer(const CallID& id) ...@@ -429,7 +429,6 @@ IAXVoIPLink::answer(const CallID& id)
call->setConnectionState(Call::Connected); call->setConnectionState(Call::Connected);
// Start audio // Start audio
audiolayer->startStream(); audiolayer->startStream();
audiolayer->flushMic();
return true; return true;
} }
...@@ -701,7 +700,6 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call) ...@@ -701,7 +700,6 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call)
} }
Manager::instance().peerAnsweredCall(id); Manager::instance().peerAnsweredCall(id);
audiolayer->flushMic();
// start audio here? // start audio here?
} else { } else {
// deja connecté ? // deja connecté ?
...@@ -805,7 +803,7 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call) ...@@ -805,7 +803,7 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
// resample // resample
nbInt16 = converter->upsampleData( spkrDataDecoded , spkrDataConverted , ac->getClockRate() , audiolayer->getSampleRate() , nbSample_); nbInt16 = converter->upsampleData( spkrDataDecoded , spkrDataConverted , ac->getClockRate() , audiolayer->getSampleRate() , nbSample_);
//audiolayer->playSamples( spkrDataConverted , nbInt16 * sizeof(SFLDataFormat), true); /* Write the data to the mic ring buffer */
audiolayer->putMain (spkrDataConverted , nbInt16 * sizeof(SFLDataFormat)); audiolayer->putMain (spkrDataConverted , nbInt16 * sizeof(SFLDataFormat));
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment