Commit 5e23b8bf by tonihei Committed by Tianyi Feng

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
parent e4695048
...@@ -2558,7 +2558,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -2558,7 +2558,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
} }
private void handleFrameRendered(long presentationTimeUs) { private void handleFrameRendered(long presentationTimeUs) {
if (this != tunnelingOnFrameRenderedListener) { if (this != tunnelingOnFrameRenderedListener || getCodec() == null) {
// Stale event. // Stale event.
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment