sync group
This commit is contained in:
parent
9021131e8d
commit
e221626191
1 changed files with 9 additions and 1 deletions
|
@ -28,7 +28,8 @@ CONFIG = {
|
|||
"sub_border_color": "0.0/0.0/0.0/0.75",
|
||||
"sub_margin": 2 * 36 + 6,
|
||||
"sub_spacing": 0,
|
||||
"vf": None
|
||||
"vf": None,
|
||||
"sync_group": None,
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,6 +278,8 @@ class Sync(Thread):
|
|||
"%0.4f %s"
|
||||
% (self.mpv.time_pos, self.mpv.playlist_current_pos)
|
||||
).encode()
|
||||
if CONFIG.get("sync_group"):
|
||||
msg = (b"%s " % CONFIG["sync_group"]) + msg
|
||||
except:
|
||||
return
|
||||
try:
|
||||
|
@ -307,6 +310,11 @@ class Sync(Thread):
|
|||
except OSError:
|
||||
logger.error("socket closed")
|
||||
else:
|
||||
if CONFIG.get("sync_group"):
|
||||
if data[0] != str(CONFIG["sync_group"]):
|
||||
return self.read_position_main()
|
||||
else:
|
||||
data = data[1:]
|
||||
self._last_ping = data[0]
|
||||
if data[0] == "pause":
|
||||
self.is_paused = True
|
||||
|
|
Loading…
Reference in a new issue