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::