From a4d61c1f29998dfaa8870056090b64a123ab5d80 Mon Sep 17 00:00:00 2001 From: acgnhik Date: Wed, 20 Jul 2022 15:41:35 +0800 Subject: [PATCH] fix: fix bug --- src/blrec/flv/operators/fix.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blrec/flv/operators/fix.py b/src/blrec/flv/operators/fix.py index e2b0911..ebe2587 100644 --- a/src/blrec/flv/operators/fix.py +++ b/src/blrec/flv/operators/fix.py @@ -77,19 +77,19 @@ def fix() -> Callable[[FLVStream], FLVStream]: def update_delta(tag: FlvTag) -> None: nonlocal delta - assert last_tag is not None - assert last_video_tag is not None - assert last_audio_tag is not None if is_video_tag(tag): + assert last_video_tag is not None delta = ( last_video_tag.timestamp - tag.timestamp + video_frame_interval ) elif is_audio_tag(tag): + assert last_audio_tag is not None delta = ( last_audio_tag.timestamp - tag.timestamp + sound_sample_interval ) + assert last_tag is not None if tag.timestamp + delta <= last_tag.timestamp: if is_video_tag(tag): delta = (