-
Notifications
You must be signed in to change notification settings - Fork 539
[FIX] ccx_encoders_smptett.c: Enforce int for sprintf #1506
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
Conversation
Refactors formatting of `col1` and `row1` variables to avoid issues with LC_NUMERIC autoformatting float values
|
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Your PR breaks these cases:
Check the result page for more info. |
src/lib_ccx/ccx_encoders_smptett.c
Outdated
| // COLUMNS is actually 90% of the screen size | ||
| // Add +10% because column 0 is at position 10% | ||
| col1 = ((100 * firstcol) / (COLUMNS / 0.8)) + 10; | ||
| col1_int = col1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to trigger a compiler warning about loss of precision. i.e. use casting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, my bad. I was also considering using a function like modf but I wanted to only use arithmetic if possible. Let me try something else.
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see inline comments
TTML specifications make no recommendation regarding decimal places for tts:origin values. Tests were done on video and no discernable difference was observed.
|
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Your PR breaks these cases:
Check the result page for more info. |
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really don't need to use a math function to convert from a float to an int :-) (losing the fractional part). A cast will do.
I'm not sure we are OK with that unneeded lost of precision though. I'd very much prefer to keep 2 or 3 decimal places.
Ah 😅 well, in that case, I'll aim for two! |
Will return integer and fractional parts of the floats, but no longer requires 3 decimal places at all times, can show less, but 1 at minimum.
|
Please make sure you test a bit before sending or updating a PR. Your code won't work for example for 3.099 Reopen the PR (or start a new one) only after you have tested with many values. Thanks! |
Got it, I'll work on this more~ |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
For issue #1483, refactors formatting of
col1androw1variables to avoid issues with LC_NUMERIC auto-formatting float values.