-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix seekbar preview crashes #11584
Fix seekbar preview crashes #11584
Conversation
Always happy to receive feedback on commenting style, extra logging, different solutions to the problem, or the PR itself :) |
Just to add some context to what happens in the linked issue:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
Sorry for interupting but i just realized that i actually do not check if the bitmap needs to be copied 🤦. Copying without that is both unneccessary and could produce memory leaks if i understand bitmaps correctly. |
Quality Gate passedIssues Measures |
Fixed crashes from recycled bitmaps by creating real copies of bitmaps if necessary + some minor refactoring
What is it?
Description of the changes in your PR
Added error handling for recycled bitmaps and fixed the issue for specific videos crashing when the preview bar was pulled to the end twice.
Bitmap.createBitmap
allows itself to NOT copy the bitmap if it is identical to the one it got passed. Since the same object is passed for bitmaps where nothing is cut out, recycling this bitmap leaves it unusable for later use.Reference: https://stackoverflow.com/a/23683075 (the first comment to that answer)
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence