Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print replay speed in FPS display #304

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zeamador
Copy link
Contributor

@zeamador zeamador commented Aug 9, 2021

Prints the replay playback rate (e.g. "1/2x", "2x", or "pause" if at the minimum rate) after the FPS in the FPS display during film playback.

Skips speed 0 so there aren't two settings that both play at 1x speed.

Also doubles the limits so we can go down to 1/10x or up to 10x.

@treellama
Copy link
Member

One quirk I noticed: it won't display "paused" if the frame rate is set to 30 fps (because it never redraws the screen)

@treellama
Copy link
Member

treellama commented Oct 25, 2021

This will leak memory each time get_replay_speed_string() is called

@zeamador
Copy link
Contributor Author

zeamador commented Nov 4, 2021

This will leak memory each time get_replay_speed_string() is called

D'oh, good point. I suppose it probably makes more sense to just move the formatting code directly into update_fps_display?

@treellama
Copy link
Member

Normally you would either return a pointer to a static buffer (like strerror does), or pass the buffer and length in from the calling function (like snprintf). The former is not re-entrant, but we don't need re-entrancy here, so that's probably the way I'd fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants