From ddadcc9ea050d33115e2fee5039481c63b0706cc Mon Sep 17 00:00:00 2001 From: Jarkko Lehtoranta Date: Tue, 13 Jun 2023 17:38:41 +0300 Subject: [PATCH] Add a health check method to player --- playback/src/player.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playback/src/player.rs b/playback/src/player.rs index 6e93258c..b15a67c1 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -495,6 +495,13 @@ impl Player { } } + pub fn is_invalid(&self) -> bool { + if let Some(handle) = self.thread_handle.as_ref() { + return handle.is_finished(); + } + true + } + fn command(&self, cmd: PlayerCommand) { if let Some(commands) = self.commands.as_ref() { if let Err(e) = commands.send(cmd) {