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

Buggy dropframe lookup when using inexact rate #1

Open
tilmans opened this issue Feb 16, 2021 · 0 comments
Open

Buggy dropframe lookup when using inexact rate #1

tilmans opened this issue Feb 16, 2021 · 0 comments

Comments

@tilmans
Copy link

tilmans commented Feb 16, 2021

Hi, thanks for publishing this, it saved me some time. I found an issue with the dropframe lookup though. The current code expects exact floats, in my case I'm calculating the FPS from a fraction "30000/1001". The result of this is not exact enough for the current code to work.

The code that works for me:

import Float.Extra as Float
...
isDropFrameRate : Float -> Bool
isDropFrameRate rate =
  [ 29.97
  , 59.94
  ]
      |> List.foldl (\r acc -> acc || Float.equalWithin 1.0e-3 r rate) False
...
Timecode frames (isDropFrameRate rate) rate
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

No branches or pull requests

1 participant