X-Git-Url: https://git.carlh.net/gitweb/?p=rtaudio-cdist.git;a=blobdiff_plain;f=RtAudio.cpp;fp=RtAudio.cpp;h=264d5f694c2b0fd0187f6957107554280b63cfab;hp=1b27de1fd5c60f883c1842d9d36272828195bb15;hb=350f2d101a5157103604a52c6e0bd88b23d620e0;hpb=e46da8995672eda8500a8567c3edcdeef9b44e3d diff --git a/RtAudio.cpp b/RtAudio.cpp index 1b27de1..264d5f6 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -8640,6 +8640,14 @@ void RtApiPulse::callbackEvent( void ) MUTEX_UNLOCK( &stream_.mutex ); RtApi::tickStreamTime(); + if (pah->s_play) { + int e = 0; + pa_usec_t const lat = pa_simple_get_latency(pah->s_play, &e); + if (e == 0) { + stream_.latency[0] = lat * stream_.sampleRate / 1000000; + } + } + if ( doStopStream == 1 ) stopStream(); }