-
Notifications
You must be signed in to change notification settings - Fork 116
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
Always null-check MediaCodec with synchronized Holder #3597
Conversation
On-device tests are failing for unrelated reason, revert pending in #3598 |
fa36367
to
11fac27
Compare
Adds a simple guard getter around mMediaCodec access, to reduce chances it gets destroyed and then accessed. Note this should really be a synchronized access instead from all call sites. b/331835987
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.
This change will convert the NPE to a IllegalStateException, it won't fix the bug.
That's the intent, yes. We won't get NPE crashes, and the IllegalState will get logged. |
This change will convert the NPE to a IllegalStateException, we already have catch blocks for IllegalStateException, so this will reduce the exceptions. |
Wraps mMediaCodec in a synchronized holder class, guaranteeing synchronized access and prevents unhandled null pointer exceptions.
This is alternate implementation to #3596
b/331835987