CodecException: Error 0xffffffff
See original GitHub issueHi. A strange issue has come about in a project.
com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:586)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.media.MediaCodec$CodecException: Error 0xffffffff
at android.media.MediaCodec.native_setSurface(Native Method)
at android.media.MediaCodec.setOutputSurface(MediaCodec.java:1901)
at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.setOutputSurface(SynchronousMediaCodecAdapter.java:165)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java:1253)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setSurface(MediaCodecVideoRenderer.java:556)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:507)
at com.google.android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:1502)
at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:1466)
at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java:1441)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:508)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
As I said before this bug arises in the strange way. What happens? I had to add supporting of ad to the project so I used ExoPlayer’s ima extensions. The application supports rotation and I keep the player inside of a retain fragment.
It happens When the first ad is playing and I change the orientation of the device at the same time. But when the main content is playing after rotation and the ad was in progress and then I try to change orientation again I will catch this exception moreover if I wait for a while and get the next ad and then I change orientation I will not catch this error. In other words I have this bug when rotation was changed when the ad was playing then it ended and then I change orientation again.
However, “codecNeedsSetOutputSurfaceWorkaround” helps to escape this error but I have a little delay therefore It’s not suitable for me.
Finally, Only emulators can work fine. I have this problem on almost all physical devices. Honestly speaking, I have not been able to repeat this issue in a demo project.
Maybe the problem is that the retain fragment re-creates views… It means that a Surface is not ready to handle the player… Can It happen? I use Widevine DASH
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (9 by maintainers)
Top GitHub Comments
This should be fixed by the commit referenced above. We’ll get it into 2.14.1.
@saurabharora90 - This issue was tracking a specific bug that would cause a
CodecException: Error 0xffffffff
to occur. However,CodecException: Error 0xffffffff
is a generic failure reported from the underlying platform, and so it’s not the case that all such errors would be caused by the bug that this issue was tracking. There are likely other causes of the same generic failure, some of which are likely in the platform itself. If you have reliable reproduction steps for causing such a failure, please file a new issue containing all of the information requested in the issue template.