Skip to content

Buffer refactor and buffer bug fixes #133

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 6 commits into from
Apr 2, 2022

Conversation

TheOneric
Copy link
Member

The refactor into a class is part of the jellyfin backports and here followed up by various bug fixes. The class members have been refactored for clarity and unused functions dropped.
As I mentioned in #120, checking the size on each frame rather than only on resizes is somewhat superfluous now (but already what happened before this change) but apparently the "smart-blend" changes will require resizes on each frame. Let’s wait until those patches come in to see if this can be improved upon.

@TheOneric TheOneric changed the title [Jellyfin] Buffer refactor and buffer bug fixes Jellyfin’s buffer refactor and buffer bug fixes Mar 24, 2022
@TheOneric TheOneric changed the title Jellyfin’s buffer refactor and buffer bug fixes Buffer refactor and buffer bug fixes Mar 24, 2022
JustAMan and others added 6 commits March 28, 2022 01:09
Cherry-picked from: jellyfin@6d3a5c7

[part of] Restructure renderBlend so it can return multiple pieces; JS side not ready yet
Cherry-picked from: jellyfin@0cc2bf8

Move private members to the top.
Renamed take to get_rawbuf for clarity.
malloc and realloc may both return NULL in absence of errors
if the size is  0. Additionally realloc acts as a free in this
case, meaning the later `return NULL;` will leave dangling
pointers in the object.
This allows to conveniently protect against
size overflows inside the ensure_size method.
Supposedly later jellyfin patches won't always need zero-initialised
memory, so we can't just do this unconditionally. I doubt this is in any
relevant way faster than an external memset, but there was a strong push
against redoing the multiplication or just zeroing the actual capacity.
@TheOneric
Copy link
Member Author

If anyone wants to take a closer look at this, write so now. If no one requests more time or objects, I'll merge this in about 2 days.

@TheOneric TheOneric merged commit 1e9d5cd into libass:master Apr 2, 2022
@TheOneric TheOneric deleted the buffer_refactor branch April 2, 2022 16:18
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.

2 participants