toro icon indicating copy to clipboard operation
toro copied to clipboard

Insufficient resources while initialising MediaCodec in Exoplayer

Open prat-z opened this issue 6 years ago • 5 comments

After playing several videos in the same app session, onPlayerError() starts getting invoked with below error message com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(1/27, null, video/avc, -1, null, [1920, 1080, -1.0], [-1, -1])

On further debugging, it was discovered that MediaCodec.java is throwing that exception with error code ERROR_INSUFFICIENT_RESOURCE.

This is also supported by the behaviour of error. Its frequency significantly increases on low performance devices, and error starts occurring after only 5-6 videos. I am streaming HLS videos on all the players. Can this be because of memory leaks and Decoder instance not getting cleaned up?

Thanks in advance!

prat-z avatar Jul 12 '18 10:07 prat-z

@eneim Any update on this?

prat-z avatar Jul 30 '18 13:07 prat-z

@prat-z really sorry. I may have forgotten this issue. Let me take a look. I think the number of MediaCodec is used up. Normally the MediaCodec is released if it is not in used. I will push some update in next few days ...

eneim avatar Jul 30 '18 13:07 eneim

Did you solve this issue?

congdanh1608 avatar Oct 05 '18 16:10 congdanh1608

@congdanh1608 Please try latest release to see if it resolves your case.

eneim avatar Oct 06 '18 07:10 eneim

Thanks @eneim I will try. But I hope the release with Exoplayer 2.8.0 will come soon. Because my project has a little complex with Exoplayer and exomedia version.

congdanh1608 avatar Oct 10 '18 03:10 congdanh1608