Skip to content

Conversation

@marcybelardo
Copy link

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

For issue #1483, refactors formatting of col1 and row1 variables to avoid issues with LC_NUMERIC auto-formatting float values.

Refactors formatting of `col1` and `row1` variables to avoid issues with LC_NUMERIC autoformatting float values
@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:

Report Name Tests Passed
Broken 0/13
CEA-708 0/14
DVB 0/7
DVD 0/3
DVR-MS 0/2
General 0/27
Hauppage 0/3
MP4 0/3
NoCC 0/10
Options 0/87
Teletext 0/21
WTV 0/13
XDS 0/34

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.

// 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;
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

@cfsmp3 cfsmp3 left a 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.
@marcybelardo marcybelardo requested a review from cfsmp3 March 20, 2023 17:06
@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:

Report Name Tests Passed
Broken 0/13
CEA-708 0/14
DVB 0/7
DVD 0/3
DVR-MS 0/2
General 0/27
Hauppage 0/3
MP4 0/3
NoCC 0/10
Options 0/87
Teletext 0/21
WTV 0/13
XDS 0/34

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.

Copy link
Contributor

@cfsmp3 cfsmp3 left a 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.

@marcybelardo
Copy link
Author

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.
@cfsmp3
Copy link
Contributor

cfsmp3 commented Mar 21, 2023

Please make sure you test a bit before sending or updating a PR. Your code won't work for example for

3.099
which will get converted to 3.99

Reopen the PR (or start a new one) only after you have tested with many values. Thanks!

@cfsmp3 cfsmp3 closed this Mar 21, 2023
@marcybelardo
Copy link
Author

Please make sure you test a bit before sending or updating a PR. Your code won't work for example for

3.099

which will get converted to 3.99

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~

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.

3 participants