aacdecoder-android-0.8 Exception when reading
aacdecoder-android-0.8 Exception when reading
I'm having a problem with the aacdecoder library on devices with Android 8. It works perfectly for a few minutes after the screen locks, approximately after 4 or 5 minutes playback stops.
The error thrown by the Android Studio console is the following:
E/BufferReader: Exception when reading: java.net.SocketException: Software caused connection abort
From what I could see, the problem is in the BufferReader.class file in this part of the code:
public void run()
Log.d(LOG, "run() started....");
int cap = this.capacity;
boolean var2 = false;
while(!this.stopped)
BufferReader.Buffer buffer = this.buffers[this.indexMine];
int total = 0;
if (cap != buffer.data.length)
Log.d(LOG, "run() capacity changed: " + buffer.data.length + " -> " + cap);
buffer = null;
this.buffers[this.indexMine] = null;
this.buffers[this.indexMine] = buffer = new BufferReader.Buffer(cap);
while(!this.stopped && total < cap)
try
int n = this.is.read(buffer.data, total, cap - total);
if (n == -1)
this.stopped = true;
else
total += n;
catch (IOException var8)
Log.e(LOG, "Exception when reading: " + var8);
this.stopped = true;
buffer.size = total;
synchronized(this)
this.notify();
int indexNew = (this.indexMine + 1) % this.buffers.length;
while(!this.stopped && indexNew == this.indexBlocked)
try
this.wait();
catch (InterruptedException var9)
;
this.indexMine = indexNew;
cap = this.capacity;
Log.d(LOG, "run() stopped.");
So far I have not been able to find the solution, I appreciate your help, thank you for your time!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.