id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 2265,Improved audio timestamp calculation on Mac OS X,awk@…,Nigel,"audiooutputca.cpp uses a combination of two timing methods, AudioGetCurrentHostTime() and gettimeofday() to calculate the timestamp of the currently playing audio. This can lead to errors in AV sync since the two calls cannot reliably be combined (gettimeofday is also potentially less efficient). Lastly the current base class implementation of SetAudiotime acquires a pair of locks which may cause priority inversion on Mac OS X when called from the high priority audio rendering thread provided by the OS. The attached patch to audiooutputca overrides SetAudiotime and GetAudiotime to use AudioGetCurrentHostTime without acquiring a lock (the single 32bit variable used doesn't need the protection). This does also however require changing the visibility of pSoundStretch, audbuf_timecode and audiotime from private to protected so that the derived class can access them - hence the patch to audiooutputbase.h",patch,closed,minor,unknown,mythtv,,medium,fixed,,,0