Updated mpsync FPS retrieval for new mpv version.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 16 Oct 2017 03:32:07 +0000 (05:32 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 16 Oct 2017 03:32:07 +0000 (05:32 +0200)
mpsync

diff --git a/mpsync b/mpsync
index 62008f0..cd8b08c 100755 (executable)
--- a/mpsync
+++ b/mpsync
@@ -98,6 +98,7 @@ class target(object):
         self.sk.connect(path)
         self.obuf = bytearray()
         self.ibuf = bytearray()
         self.sk.connect(path)
         self.obuf = bytearray()
         self.ibuf = bytearray()
+        self.fps = self.getprop("container-fps")
 
     def write(self, data):
         self.obuf.extend(data)
 
     def write(self, data):
         self.obuf.extend(data)
@@ -246,7 +247,7 @@ def main(tty):
         elif c == 'S':
             offsets = getoffsets()
             for tgt, off in zip(targets, offsets):
         elif c == 'S':
             offsets = getoffsets()
             for tgt, off in zip(targets, offsets):
-                tgt.runcmd("show_text", "Offset: %f" % off)
+                tgt.runcmd("show_text", "Offset: %i" % round(off * tgt.fps))
         elif c == '.':
             runcmd("frame_step")
             paused = True
         elif c == '.':
             runcmd("frame_step")
             paused = True