[client] audio/pw: return the actual playback latency

This commit is contained in:
Geoffrey McRae 2022-01-19 00:03:16 +11:00
parent 4fadf3a130
commit d6bbc4f89c

View File

@ -366,7 +366,14 @@ static void pipewire_playbackMute(bool mute)
static size_t pipewire_playbackLatency(void)
{
return 0;
struct pw_time time = { 0 };
pw_thread_loop_lock(pw.thread);
if (pw_stream_get_time(pw.playback.stream, &time) < 0)
DEBUG_ERROR("pw_stream_get_time failed");
pw_thread_loop_unlock(pw.thread);
return time.delay + time.queued / pw.playback.stride;
}
static void pipewire_recordStopStream(void)