Skip to content

Commit 9015f9f

Browse files
committed
ffmpeg_editlist: --show-schedule don't show seconds
1 parent a3579cb commit 9015f9f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ffmpeg_editlist.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ def test_seconds():
125125
assert seconds('1:30') == 90
126126
assert seconds('1:1:30') == 3690
127127
assert seconds('1:1:30.5') == 3690.5
128-
def humantime(x, show_hour=False):
128+
def humantime(x, show_hour=False, show_second=True):
129129
hou = x // 3600
130130
min = (x % 3600) // 60
131131
sec = x % 60
132+
if not show_second:
133+
sec = round(sec/60)*60
134+
return "%d:%02d"%(hou, min)
132135
if hou or show_hour:
133136
return "%d:%02d:%02d"%(hou, min, floor(sec))
134137
return "%02d:%02d"%(min, floor(sec))
@@ -224,7 +227,7 @@ def _emit(self, time=None):
224227
if time is not None:
225228
delta = f" ({round((time - self.lasttime)/60):>2d} min)"
226229
if self.enabled:
227-
print(f"{humantime(seconds(self.lasttime) + self.delta):>8s}{delta} {self.lasttitle}")
230+
print(f"{humantime(seconds(self.lasttime) + self.delta, show_second=False):>5s}{delta} {self.lasttitle}")
228231
def __del__(self):
229232
self._emit()
230233

0 commit comments

Comments
 (0)