-
Notifications
You must be signed in to change notification settings - Fork 245
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
Fix for MPEG-1 video pixel aspect ratio #411
Conversation
The reciprocal of the actual value was being returned for MPEG-1 video. Files with square pixels were not affected, nor were MPEG-2 files listing a display aspect ratio. Fixes JamesHeinrich#410
This gives a nice 320px result instead of 321 point something when producing square pixel output and is commonly used.
Getting this warning: Binary operation "/" between 1 and 0.0|0.6735|0.7031|0.7615|0.8055|0.8437|0.8935|0.91666666666667|0.9815|1.0|1.0255|1.0695|1.1|1.1575|1.2015|1.3333|1.7778|2.21 results in an error. Hopefully this will convince it that it won't divide by zero?
I don't understand why static analysis thinks the division can cause an error here -- the only possible error is divide by zero, which is guarded explicitly against. |
It might be dumb, but... We have a check |
|
There is a guard specifically for $ratio != 0 so I'm confused why 1 / $ratio is troublesome to the analyzer. :) |
@Brion The ratio is always casted to a float before this afaik, in which case 0.0 (as float rather than int) should work equally well, and satisfy the analyser. You could then also use strict equality, which would currently fail. I'm guessing the analyser is using strict equality to conservatively narrow down possible values. |
@Krinkle wrote:
I'll try that in a followup and see if it helps. :) |
The reciprocal of the actual value was being returned for MPEG-1 video. Files with square pixels were not affected, nor were MPEG-2 files listing a display aspect ratio.
Fixes #410