Rework the cache reset when resize the canvas#27
Draft
dmitrylyzo wants to merge 1 commit intojellyfin:masterfrom
Draft
Rework the cache reset when resize the canvas#27dmitrylyzo wants to merge 1 commit intojellyfin:masterfrom
dmitrylyzo wants to merge 1 commit intojellyfin:masterfrom
Conversation
dmitrylyzo
commented
May 5, 2022
| if (item.emptyFinish < 0 || item.eventFinish >= maxTime) break; | ||
|
|
||
| if (item.eventFinish >= minTime && | ||
| !fuzzyEqualRect(item.viewport, self.canvas, self.resizeVariation)) continue; |
Collaborator
Author
There was a problem hiding this comment.
With continue the far good frames take up some size, leaving less room for the near frames and making a gap.
This can happen with smooth resizing, when the far frames are more recent and correspond to the current canvas size.
Using break forces to rerender the good frames.
UPD:
On the other hand, I don't like the fact that the set of newly rendered frames (perfect ones) will be interrupted by the saved "good" ones. So using break makes the set to be consistent in terms of quality.
37f01ed to
c6f6d24
Compare
c6f6d24 to
5529848
Compare
5529848 to
05ef61d
Compare
Compare the resolution of each frame with the current canvas size. Compare the subtitle display end time, not the gap end time. Keep some frames within specified time regardless of the resolution. Discard distant frames if maximum time is specified.
05ef61d to
03971c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Issues
In theory (more for increasing the size):
Resizing the canvas with, say, 15% step, the old version keeps ~30s (if the size limit allows) of low-res frames instead of discarding them.