Fix wrong success state upon reading zero bytes
This commit is contained in:
@@ -176,7 +176,8 @@ class ListenService : Service() {
|
|||||||
while (!Thread.currentThread().isInterrupted) {
|
while (!Thread.currentThread().isInterrupted) {
|
||||||
val len = inputStream.read(readBuffer)
|
val len = inputStream.read(readBuffer)
|
||||||
if (len < 0) {
|
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)
|
val decoded: Int = AudioCodecDefines.CODEC.decode(decodedBuffer, readBuffer, len, 0)
|
||||||
if (decoded > 0) {
|
if (decoded > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user