Skip to content

Fixed rate command - #64

Open
qarkai wants to merge 5 commits into
byroot:masterfrom
qarkai:master
Open

Fixed rate command#64
qarkai wants to merge 5 commits into
byroot:masterfrom
qarkai:master

Conversation

@qarkai

@qarkai qarkai commented Oct 23, 2016

Copy link
Copy Markdown

If ratio is final/initial then time should be divided by it, not multiplied.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 71.919% when pulling cb62de3 on qarkai:master into 331b344 on byroot:master.

2 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 71.919% when pulling cb62de3 on qarkai:master into 331b344 on byroot:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 71.919% when pulling cb62de3 on qarkai:master into 331b344 on byroot:master.

@byroot byroot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand why this way would be more logical than the previous one.

Comment thread pysrt/srttime.py Outdated
return self.from_ordinal(int(round(self.ordinal / ratio)))

def __itruediv__(self, ratio):
self.ordinal = int(round(self.ordinal / ratio))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not call __idiv__ instead of copying the code?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Agreed.

@qarkai

qarkai commented Oct 23, 2016

Copy link
Copy Markdown
Author

The more framerate the less time value should be because there will be more text per second.
Frame = Time * Framerate. Frame is the same, Framerate changes, we need to calculate new Time:
T_new * F_new = T_old * F_old
T_new = T_old * (F_old/F_new)
Since Ratio = F_new/F_old then
T_new = T_old * (1/Ratio)
T_new = T_old/Ratio

@coveralls

coveralls commented Oct 23, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 72.267% when pulling 32361e2 on qarkai:master into 331b344 on byroot:master.

@coveralls

coveralls commented Oct 23, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 72.267% when pulling 9598d82 on qarkai:master into 331b344 on byroot:master.

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