IllegalStateException: buffer is inaccessible
Hi, I have found the issue [https://github.com/google/ExoPlayer/issues/729], but in my case malformed stream is not the reason. I have faced the issue while trying to get DirectByteBuffer on Nexus 5X Android 7.0 (sampleHolder.data.duplicate()) and get error buffer is inaccessible. Same stream works correctly on Samsung S6 and J7 with Android 6.0.1. Please advice on this issue.
Please provide all of the information requested in the issue template, otherwise we don't have enough data to help. Thanks!
@ojw28 Thanks for reply. While preparing sample to reproduce problem on Demo app, I figured out what the problem was... Multithreading. So I was trying to get access to ByteBuffer from another thread. In API < 24 it worked correctly, but for API 24 it was changed and is not allowed anymore (most likely).
Hi @mkovalyk could you post your solution to solve this type of error?
I have a queue (ArrayList<ArrayDeque
ByteBuffer muxerInput; synchronized (mMuxerInputQueue) { muxerInput = mMuxerInputQueue.get(trackIndex).isEmpty() ? ByteBuffer.allocateDirect(encodedData.capacity()) : mMuxerInputQueue.get(trackIndex).remove(); muxerInput.put(encodedData); muxerInput.position(0); }
The error is in the line: muxerInput.put - muxerInput buffer is inaccessible
Any help please?
Thanks.