[mythtv-commits] Ticket #2265: Improved audio timestamp calculation on Mac OS X

MythTV mythtv at cvs.mythtv.org
Mon Aug 28 15:22:58 UTC 2006

#2265: Improved audio timestamp calculation on Mac OS X
 Reporter:  awk at awkward.org  |       Owner:  ijr
     Type:  patch            |      Status:  new
 Priority:  minor            |   Milestone:     
Component:  mythtv           |     Version:     
 Severity:  medium           |  
 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

Ticket URL: <http://svn.mythtv.org/trac/ticket/2265>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list