Fix wrong success state upon reading zero bytes

This commit is contained in:
edr
2024-03-20 20:14:45 +01:00
parent 1018ded2d9
commit b874584cf7

View File

@@ -176,7 +176,8 @@ class ListenService : Service() {
while (!Thread.currentThread().isInterrupted) {
val len = inputStream.read(readBuffer)
if (len < 0) {
return true
// If the current thread was not interrupted this means the remote stopped streaming
return Thread.currentThread().isInterrupted
}
val decoded: Int = AudioCodecDefines.CODEC.decode(decodedBuffer, readBuffer, len, 0)
if (decoded > 0) {