handle shutdown
This commit is contained in:
parent
dcc528896a
commit
f8d139e36f
1 changed files with 4 additions and 1 deletions
|
@ -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<EventListener> {
|
||||
// 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),
|
||||
|
|
Loading…
Reference in a new issue