mirror of
https://github.com/samsonjs/media.git
synced 2026-04-09 11:55:46 +00:00
Check if codec still exists before handling tunneling events
The tunneling callbacks are sent via Handler messages and may be
handled after the codec/surface was changed or released.
We already guard against the codec/surface change condition by
creating a new listener and verifying that the current callback
happens for the correct listener instance, but we don't guard
against a released codec yet.
PiperOrigin-RevId: 495882353
(cherry picked from commit 49ccfd6383)
This commit is contained in:
parent
097cdded3f
commit
da6c2dfa64
1 changed files with 1 additions and 1 deletions
|
|
@ -2050,7 +2050,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||
}
|
||||
|
||||
private void handleFrameRendered(long presentationTimeUs) {
|
||||
if (this != tunnelingOnFrameRenderedListener) {
|
||||
if (this != tunnelingOnFrameRenderedListener || getCodec() == null) {
|
||||
// Stale event.
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue