Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Search backwards for keyframe when resuming playback #11713
Currently, when resuming playback of a video, a human can easily notice how the player will jump up to several seconds ahead of the resume point. The reason being that the player will seek to the closest keyframe after the position one wants to jump to.
Instead of skipping a few seconds after resuming, the last couple of seconds will be repeated and the user will not miss content.
Types of change
Looks like a trivial change on first glance but we rely heavily on ffmpeg here. Setting the backward flag on first seek is probably not the normal case. There are many different containers with their own seek functions. To be save all those needs to be tested with this change.
EDIT: I was referring to backport.
@dgam1 I was not referring to implementations of CDVDDemux but to containers like mkv, avi, mpegts, etc. Every container (ffmpeg calls it a format) has its own way of seeking. In particular formats without an index like mpegts may do harder in finding a key frame before the seek pos.
Not long ago I fixed an issue in ffmpeg that made seeking in mkv containers stall up to 10 seconds. This just should underpin that seeking in general is not a trivial process and even a tiny change should not be underestimated.