diff --git a/app/src/main/kotlin/de/rochefort/childmonitor/ListenService.kt b/app/src/main/kotlin/de/rochefort/childmonitor/ListenService.kt index 8789def..59400ff 100644 --- a/app/src/main/kotlin/de/rochefort/childmonitor/ListenService.kt +++ b/app/src/main/kotlin/de/rochefort/childmonitor/ListenService.kt @@ -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) {