Skip to content

Jellyfin’s dropAllAnimations #134

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

Merged
merged 3 commits into from
May 7, 2022

Conversation

TheOneric
Copy link
Member

@TheOneric TheOneric commented Apr 2, 2022

Adds the corrected core animation detection and deletion code for dropAllAnimations and renderAhead and backports dropAnimations from jellyfin.

@dmitrylyzo Could you take a look at this to check if I missed to backport any relevant fixes for dropAllAnimations? In particular there’s 08f72cd which refers to “lite mode” in its title, but iiuc the actual changes are all in the renderAhead portion.

To aid readability by making it easy to see all class-local
variables and their types and visibility.
@TheOneric TheOneric force-pushed the jf_drop_animations branch from e23b54c to 64feebc Compare April 2, 2022 22:12
Copy link
Contributor

@dmitrylyzo dmitrylyzo left a comment

Choose a reason for hiding this comment

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

I have not tested this in action. Only the main part in that big PR, and it seemed to work fine. The rest - just visually.

case '{':
// Escaping the opening curly bracket to not start an override block is
// a VSFilter incompatiple libass extension. But we only use libass, so...
if (!block_start && (p == event->Text || *(p-1) != '\\'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the escaping be parsed with the boolean flag?
For something like bla-bla \\{\pos(100,200)}.
libass doesn't seem to escape the backslash either: 1\\N2 gets a new line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I don't understand what your suggesting with a “boolean flag”. Can you elaborate?
Also there aren't any backslashes being escaped being checked, but backslashes escaping curly brackets (working only in libass).

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that the condition only checks the previous backslash, but there can be another one before it. In this case something like if (*p == '\\') escaped = !escaped; is required. But since libass (SSA/ASS standard) has no escaping logic, the current implementation is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great, then it seems this is ready to be merged.

TheOneric and others added 2 commits May 7, 2022 15:41
This prepares the dropAnimations and renderAhead features from
jellyfin, though the functions are not yet used. The implementation in
this commit completly replaces the faulty code from jellyfin, which was
added in the misleadingly named "Less zealous logging" commit
jellyfin@6980deb

The old version was not detecting valid ASS tags like '\t  (\frz50'
and did some other checks not backed by ASS' behaviour. Rewrite it from
scratch to not miss any animated tags.
The previous version made an attempt to also detect and not report noop
animation tags like '\move(1,1,1,1)'; the new version does not as
correctly parsing the tag and its values is simply more effort than its
worth and likely to result in false negatives. Noop animation tags
should be sufficiently rare anyway.
Original implementation by JustAMan, mostly in the following
three commits sans unrelated changes. Backported by Oneric.
jellyfin@d3bc472
jellyfin@a66e797
jellyfin@971a997

The commits have also been adjusted to apply on top of current upstream
master, to use the animations detection from the previous commit instead
of the faulty original logic and the scanned_events variable was added.
Also added documentation which was missing in the original commits.

Co-authored-by: Oneric <oneric@oneric.stub>
@TheOneric TheOneric force-pushed the jf_drop_animations branch from 64feebc to 5b42203 Compare May 7, 2022 13:43
@TheOneric TheOneric merged commit 5b42203 into libass:master May 7, 2022
@TheOneric TheOneric deleted the jf_drop_animations branch May 7, 2022 18:41
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