diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-07-22 21:21:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-07-22 21:21:35 +0200 |
| commit | 73cf4256716ed06ca63f3b1d890f742d695a7e77 (patch) | |
| tree | 091ac6b64c9c40e0d33a71a8089041e25e848f0b /RtAudio.cpp | |
| parent | b4f04903312e0e0efffbe77655172e0f060dc085 (diff) | |
Report playback latency for PulseAudio.
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index b13f04e..22ef313 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -9772,6 +9772,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(); } |
