- Forum posts: 2
Aug 28, 2018, 7:38:40 PM via Website
Aug 28, 2018 7:38:40 PM via Website
0
down vote
favorite
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!
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.