-
Notifications
You must be signed in to change notification settings - Fork 575
Description
Version
Media3 main branch
More version details
I have bug similar to issue #8329 which addressed MediaCodec format handling, this enhancement would add proactive Surface state management to prevent common MediaCodec crashes.
The most common crash pattern we observe:
androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
Caused by: java.lang.IllegalArgumentException
at android.media.MediaCodec.native_setSurface(Native Method)
at android.media.MediaCodec.setOutputSurface(MediaCodec.java:1979)
at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.setOutputSurface
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.setOutputSurfaceV23
This is a known bug of some implementations of some platform video codecs. ExoPlayer can not fix it, only workaround it by releasing the codec and then re-initializing it instead of setting the outputSurface:
ExoPlayer/library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
I create pull request for add needed Util.Device value (sberbox) in function evaluateDeviceNeedsSetOutputSurfaceWorkaround
Devices that reproduce the issue
SberBox tv consoles
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
- Start video
- Stop video
- Delay 5 minutes
- Start screensaver Activity
- Close screensaver
Expected result
The media don't crash after start screensaver
Actual result
The most common crash pattern we observe:
androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
Caused by: java.lang.IllegalArgumentException
at android.media.MediaCodec.native_setSurface(Native Method)
at android.media.MediaCodec.setOutputSurface(MediaCodec.java:1979)
at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.setOutputSurface
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.setOutputSurfaceV23
Media
https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
Bug Report
- You will email the zip file produced by
adb bugreport
to android-media-github@google.com after filing this issue.