sync reads position, log sync
This commit is contained in:
parent
a604bdfab9
commit
efd5e7310a
1 changed files with 3 additions and 2 deletions
|
@ -75,11 +75,11 @@ class Sync(Thread):
|
||||||
if self.is_main:
|
if self.is_main:
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
else:
|
else:
|
||||||
self.read_position_main()
|
|
||||||
#self.adjust_position()
|
|
||||||
if self.need_to_sync:
|
if self.need_to_sync:
|
||||||
self.sync_to_main()
|
self.sync_to_main()
|
||||||
self.need_to_sync = False
|
self.need_to_sync = False
|
||||||
|
else:
|
||||||
|
self.read_position_main()
|
||||||
self.reload_playlist()
|
self.reload_playlist()
|
||||||
if self._tick and abs(time.time() - self._tick) > 60:
|
if self._tick and abs(time.time() - self._tick) > 60:
|
||||||
logger.error("player is stuck")
|
logger.error("player is stuck")
|
||||||
|
@ -186,6 +186,7 @@ class Sync(Thread):
|
||||||
return float(sum(sorted(lst)[quotient - 1:quotient + 1]) / 2.0)
|
return float(sum(sorted(lst)[quotient - 1:quotient + 1]) / 2.0)
|
||||||
|
|
||||||
def sync_to_main(self):
|
def sync_to_main(self):
|
||||||
|
logger.error('sync to main')
|
||||||
self.read_position_main()
|
self.read_position_main()
|
||||||
#print(self.main.playlist_current_pos)
|
#print(self.main.playlist_current_pos)
|
||||||
if self.main.playlist_current_pos != self.mpv.playlist_current_pos:
|
if self.main.playlist_current_pos != self.mpv.playlist_current_pos:
|
||||||
|
|
Loading…
Reference in a new issue