mozilla / cubeb-coreaudio-rs

The audio backend of Firefox on Mac OS X.
ISC License
25 stars 10 forks source link

frames_queued and total_output_latency_frames may not update in a synchronized fashion #108

Open mstange opened 4 years ago

mstange commented 4 years ago

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.