frames_queued is in the TripleBuffer, but total_output_latency_frames is not (it's a separate atomic), so position() might be using two values from different invocations to the audio output callback. This is probably not a big problem in practice, because total_output_latency_frames probably does not vary very much if the audio callback is called at consistent times. But it's probably still worth fixing, by moving total_output_latency_frames into the TripleBuffer.
frames_queued
is in the TripleBuffer, buttotal_output_latency_frames
is not (it's a separate atomic), soposition()
might be using two values from different invocations to the audio output callback. This is probably not a big problem in practice, becausetotal_output_latency_frames
probably does not vary very much if the audio callback is called at consistent times. But it's probably still worth fixing, by movingtotal_output_latency_frames
into theTripleBuffer
.