From b1e065d1f9c64107403b8b7bd6cd1f5d2cc140f9 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 17 May 2022 15:52:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=89=87=E6=AE=B5=E8=BF=87?= =?UTF-8?q?=E5=B0=8F=EF=BC=8C=E7=9B=B4=E6=8E=A5=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danmaku_workflow.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/danmaku_workflow.py b/danmaku_workflow.py index a5a5abd..a59fcc6 100644 --- a/danmaku_workflow.py +++ b/danmaku_workflow.py @@ -475,6 +475,9 @@ class WorkerThread(QThread): duration = self.get_video_real_duration(file) current_sec = 0 while current_sec < duration: + if (current_sec + VIDEO_CLIP_OVERFLOW_SEC * 2) > duration: + print("[-]Less than 2 overflow sec, skip") + break current_dt = (create_dt + timedelta(seconds=current_sec)).strftime("%Y%m%d_%H%M_") print("CUR_DT", current_dt) print("BIAS_T", current_sec) @@ -559,6 +562,7 @@ def danmaku_to_subtitle(file: Union[os.PathLike[str], str], time_shift: float): process.wait() return new_subtitle_name + # Create a set of arguments which make a ``subprocess.Popen`` (and # variants) call work with or without Pyinstaller, ``--noconsole`` or # not, on Windows and Linux. Typical use::