fix(video): resolve playback freeze caused by aggressive re-seek - #4
Open
aldegad wants to merge 2 commits into
Open
fix(video): resolve playback freeze caused by aggressive re-seek#4aldegad wants to merge 2 commits into
aldegad wants to merge 2 commits into
Conversation
…frame skipping During playback with speed-adjusted clips, the media sync was re-seeking video elements every 50ms when drift exceeded 0.15s. This interrupted the decoder, causing it to fall further behind, creating a vicious cycle that resulted in ~1 FPS visual output on capable hardware. Three changes fix this: - Remove frame skip in renderer: always draw the current video frame during playback instead of skipping when drift > 0.1875s - Relax sync drift threshold from 0.15s to 0.8s during playback to let the video decoder catch up naturally - Keep strict 0.15s threshold for scrubbing/pause where accuracy matters https://claude.ai/code/session_01JrQh18dyZyLDU5U8MCHQie
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af8af4b770
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Comment on lines
160
to
+163
| const videoSeekThreshold = | ||
| desiredState.isAudible && !isWebAudioReadyRef.current(clip.sourceUrl) | ||
| ? Math.max(PLAYBACK.SEEK_DRIFT_THRESHOLD, 0.45) | ||
| : PLAYBACK.SEEK_DRIFT_THRESHOLD; | ||
| ? Math.max(PLAYBACK.PLAYBACK_SEEK_DRIFT_THRESHOLD, 0.8) | ||
| : PLAYBACK.PLAYBACK_SEEK_DRIFT_THRESHOLD; |
There was a problem hiding this comment.
재생 중 타임라인을 짧게 seek(예: ±0.2~0.7초)하면 videoSeekThreshold가 0.8초로 완화되어 video.currentTime 보정이 발생하지 않습니다. 이 경로에서 seek()는 재생을 멈추지 않고 타임라인 시간만 점프시키기 때문에, 비디오 엘리먼트와 타임라인이 같은 속도로 계속 진행되며 생긴 오프셋이 사라지지 않아 영구적인 A/V·플레이헤드 불일치가 됩니다(이전 임계값 0.15/0.45에서는 빠르게 복구되던 동작).
Useful? React with 👍 / 👎.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
원인 분석
배속 조정된 클립 재생 시 악순환 발생:
Test plan
https://claude.ai/code/session_01JrQh18dyZyLDU5U8MCHQie