diff --git a/playback.cpp b/playback.cpp index 4e13572..601df41 100644 --- a/playback.cpp +++ b/playback.cpp @@ -468,16 +468,14 @@ PlaybackInstance::PlaybackInstance() { } std::optional PlaybackInstance::get_current_file() { - current_file_mutex.lock(); - std::optional output = current_file; - current_file_mutex.unlock(); - return output; + if (process == nullptr) return {}; + if (!process->process_running()) return {}; + return process->get_file_path(); } std::optional PlaybackInstance::get_current_title() { - current_file_mutex.lock(); - std::optional output = current_title; - current_file_mutex.unlock(); - return output; + if (process == nullptr) return {}; + if (!process->process_running()) return {}; + return process->get_title(); } PlaybackInstance::~PlaybackInstance() { Stop();