don't sync in first second

This commit is contained in:
j 2023-11-17 01:05:50 +01:00
parent ecbd30c460
commit e4793e816c

View file

@ -180,8 +180,10 @@ class Sync(Thread):
frames = deviation / 0.04
median_frames = median_deviation / 0.04
if time.time() - self.last_sync > SYNC_GRACE_TIME and abs(median_deviation) > SYNC_TOLERANCE:
if not self.need_to_sync:
logger.error('need to sync %0.05f (%d) median %0.05f (%d)' % (deviation, frames, median_deviation, median_frames))
if self.mpv.time_pos > 2 and not self.need_to_sync:
logger.error(
'%0.05f need to sync %0.05f (%d) median %0.05f (%d)' % (self.mpv.time_pos, deviation, frames, median_deviation, median_frames)
)
self.need_to_sync = True
def median(self, lst):