From 7d091382c073f2b73ff70bfa7dcc001bf4e57574 Mon Sep 17 00:00:00 2001 From: Koen Date: Sun, 7 Jan 2024 21:56:56 +0100 Subject: [PATCH] Do not restart threads when started is false. --- .../java/com/futo/platformplayer/casting/FCastCastingDevice.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/futo/platformplayer/casting/FCastCastingDevice.kt b/app/src/main/java/com/futo/platformplayer/casting/FCastCastingDevice.kt index 13a0839e..9e12f78c 100644 --- a/app/src/main/java/com/futo/platformplayer/casting/FCastCastingDevice.kt +++ b/app/src/main/java/com/futo/platformplayer/casting/FCastCastingDevice.kt @@ -252,7 +252,7 @@ class FCastCastingDevice : CastingDevice { val thread = _thread val pingThread = _pingThread - if (thread == null || !thread.isAlive || pingThread == null || !pingThread.isAlive) { + if (_started && (thread == null || !thread.isAlive || pingThread == null || !pingThread.isAlive)) { Log.i(TAG, "(Re)starting thread because the thread has died") _scopeIO?.let {