maxcurzi / tplay

A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.
MIT License
208 stars 13 forks source link

[BUG] non-integer frame rates are truncated #15

Closed maxcurzi closed 1 year ago

maxcurzi commented 1 year ago

Describe the bug Non-integer framerates like 23.976 are truncated down to 23, etc. This occurs because there is a wrong calculation in the "should send frame" function. It casts self.fps to u64 before performing the division: 1_000_000_000u64 / fps as u64 should be (1_000_000_000f64 / fps) as u64

maxcurzi commented 1 year ago

fixed with 14058ea5b20d885ca1958f8cedddcef6b7810802