diff --git a/src/mpv.rs b/src/mpv.rs index 6e1332d..24a5adc 100644 --- a/src/mpv.rs +++ b/src/mpv.rs @@ -133,7 +133,6 @@ impl Handle { Error::from_return_code(unsafe { ffi::mpv_command(self.inner.as_ptr(), args) }) } - // TODO: return None on SHUTDOWN possibly? pub fn tick(&self) -> Option { // take listener before we drain the event queue, so we don't miss any notifications let listener = self.wakeup.listen(); @@ -157,6 +156,10 @@ impl Handle { print!("[{prefix}] {level}: {text}"); } + ffi::mpv_event_id_MPV_EVENT_SHUTDOWN => { + return None; // good bye forever + } + 11 => { /* deprecated, ignore */ } _ => todo!("event {}", event.event_id),