You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3d8254f
Browse filesBrowse the repository at this point in the historyBrowse files
fix: start playback after a seek at the position asked for (#493)
* fix: start playback after a seek at the position asked for
The reader lands on the keyframe before the position. The player now decodes from there, drops the video before the position and cuts the audio frame it falls in.
* perf: drop the frames before a seek's position before converting them
The video decoder drops them as they come out of the codec, so a frame decoded in hardware is not read back and none goes through swscale. While the hardware is on probation they are converted all the same, since only a full picture ends it.
Looping keeps the timing across the seam, so a looping file works as a stand-in for a camera that never stops. A looping source never reports an end of stream.
146
146
147
-
A seek lands on the keyframe at or before the position asked for, which is how far back the decoder has to go to produce a picture at all. How close that is to the position asked for depends on how often the media was encoded with keyframes.
147
+
A seek starts playback at the position asked for. The decoder has to go back to the keyframe at or before it to produce a picture at all, so the frames from there up to the position are decoded and dropped, and the audio is cut at it. How long a seek takes therefore depends on how often the media was encoded with keyframes.
0 commit comments