Seek backwards/forwards in replays by checkpoint#18238
Merged
LibretroAdmin merged 12 commits intolibretro:masterfrom Sep 9, 2025
Merged
Seek backwards/forwards in replays by checkpoint#18238LibretroAdmin merged 12 commits intolibretro:masterfrom
LibretroAdmin merged 12 commits intolibretro:masterfrom
Conversation
Jamiras
reviewed
Sep 5, 2025
| ) | ||
| MSG_HASH( | ||
| MENU_ENUM_SUBLABEL_INPUT_META_PREV_REPLAY_CHECKPOINT_KEY, | ||
| "Rewinds the replay to the previous automatically or manually saved checkpoint." |
Contributor
There was a problem hiding this comment.
How are checkpoints created automatically?
Contributor
Author
There was a problem hiding this comment.
There's an interval in seconds that's a setting in the RA config.
Contributor
Author
|
I want to change the "find the previous checkpoint" code to not be side-effecting on the movie, so please don't merge until my next patch lands. I also am adding the "seek forward or back to (the closest replay checkpoint before) a given frame number" text command. |
Merged
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.
This adds three keybinds/text commands: make a checkpoint, go to previous checkpoint, and go to next checkpoint. It also adds a text (stdin/socket) command to seek a replay to a specific frame, which will also return (via the command replier) the frame which was actually seeked-to (for now, it will only seek to checkpoint frames, since afaik there is no API for running retroarch forward by some number of frames).
This even works for replays being recorded; backwards seeking works as expected but forwards seeking can also work if the replay was seeked-backwards while paused.
I would like particularly close review around:
run_frames_and_pause) used to activate the forward/back scanning logic while pausedI like to bind "make checkpoint" to f2 (same as save-state) and use n/m to go back/forward through checkpoints.
In the future it would be good if seeking backwards could use the backref field in replay frames to more efficiently go backwards, but it would depend on remembering the file position at which a statestream block was written in the replay file so it could be reloaded if it had been garbage-collected (which feels like a separate PR). For now, scanning backwards requires scanning forwards from the beginning of the replay, which is not ideal but it is what it is.