ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Buffer is inaccessible and IllegalStateException

Open ppamorim opened this issue 11 years ago • 8 comments

Hi everyone. The logcat says:

java.lang.IllegalStateException: buffer is inaccessible
        at java.nio.DirectByteBuffer.checkIsAccessible(DirectByteBuffer.java:551)
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:352)
        at com.google.android.exoplayer.extractor.RollingSampleBuffer.readData(RollingSampleBuffer.java:287)
        at com.google.android.exoplayer.extractor.RollingSampleBuffer.readSample(RollingSampleBuffer.java:193)
        at com.google.android.exoplayer.extractor.DefaultTrackOutput.getSample(DefaultTrackOutput.java:142)
        at com.google.android.exoplayer.hls.HlsExtractorWrapper.getSample(HlsExtractorWrapper.java:186)
        at com.google.android.exoplayer.hls.HlsSampleSource.readData(HlsSampleSource.java:298)
        at com.google.android.exoplayer.MediaCodecTrackRenderer.feedInputBuffer(MediaCodecTrackRenderer.java:607)
        at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:502)
        at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:417)
        at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:205)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
        at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

And:

java.lang.IllegalStateException
        at android.media.MediaCodec.native_stop(Native Method)
        at android.media.MediaCodec.stop(MediaCodec.java:631)
        at com.google.android.exoplayer.MediaCodecTrackRenderer.releaseCodec(MediaCodecTrackRenderer.java:439)
        at com.google.android.exoplayer.MediaCodecTrackRenderer.onDisabled(MediaCodecTrackRenderer.java:409)
        at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onDisabled(MediaCodecVideoTrackRenderer.java:328)
        at com.google.android.exoplayer.TrackRenderer.disable(TrackRenderer.java:219)
        at com.google.android.exoplayer.ExoPlayerImplInternal.stopAndDisable(ExoPlayerImplInternal.java:538)
        at com.google.android.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:525)
        at com.google.android.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:502)
        at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:239)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
        at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

Using the last version of the ExoPlayer, happens at LG G2, S4 and Moto E. If you want to test, start a new HLS stream with this address: http://i2.vejoaovivo.com.br:1935/1dia/d6b1c9f0-3708-11e5-9a60-35a00edea567.stream/playlist.m3u8 Another m3u8 address: http://i2.vejoaovivo.com.br:1935/1dia/d6b1c9f0-3708-11e5-9a60-35a00edea567.stream/playlist.m3u8

I don't know if it's a problem with my the stream or the library, but happens with HLS stream. Why this don't have any handle? Thanks!

ppamorim avatar Aug 20 '15 17:08 ppamorim

We need more information to look at issues like this. Like what version of the library you're using, on what device(s) you see these issues, how reproducible it is on the affected devices, and on different devices. Also, do these issues happen with the test streams in the demo app, or only with specific streams?

ojw28 avatar Aug 20 '15 17:08 ojw28

@ojw28 Infos added

ppamorim avatar Aug 20 '15 17:08 ppamorim

Please clarify what "latest version" means. Which branch are you pulling code from (or which version are you pulling, if you're including it as a prebuilt aar/jar)? Thanks!

ojw28 avatar Aug 20 '15 17:08 ojw28

@ojw28 I cloned the repository and added the library (the master branch) at my project, I saw that the last commit is 16 days ago and I've added the ExoPlayer at least one week. It's the last version I think...

ppamorim avatar Aug 20 '15 17:08 ppamorim

I can reproduce with the test streams provided. I don't know why it's failing though. The underlying decoder is very unhappy, so it's quite possible that the stream contains invalid/malformed H.264. It's also possible that we're somehow parsing it out incorrectly.

ojw28 avatar Aug 20 '15 18:08 ojw28

@ojw28, another question, the first one stream works at the us website: https://camerite.com/cameras/1367/hungary/budapest/budapest

ppamorim avatar Aug 20 '15 19:08 ppamorim

Closing this on the assumption that the media is malformed. We haven't seen this reported by anyone else, which suggests that it's not a widespread issue.

ojw28 avatar Jun 09 '16 23:06 ojw28

Hi. I have faced the same issue. So I had Exoplayer version 1.5.10. However I have it only on Nexus 5X with Android 7.0. Same stream works correctly on Samsung S6 and J7 with Android 6.0.1.

mkovalyk avatar Sep 22 '16 09:09 mkovalyk