mpv oopsie

This commit is contained in:
Erica Z 2024-10-30 08:44:25 +01:00
parent e02bc10ebc
commit 4ca473eb11

View file

@ -4,7 +4,8 @@
#[allow(unreachable_code)] #[allow(unreachable_code)]
mod ffi; mod ffi;
#[link(name = "mpv")] extern "C" {} #[link(name = "mpv")]
extern "C" {}
pub struct Error(std::ffi::c_int); pub struct Error(std::ffi::c_int);
@ -56,7 +57,7 @@ impl Handle {
name: unsafe { std::ffi::CStr::from_ptr(data.name) } name: unsafe { std::ffi::CStr::from_ptr(data.name) }
.to_str() .to_str()
.unwrap(), .unwrap(),
value: unsafe { FormatData::new(data.format, data.data)}, value: unsafe { FormatData::new(data.format, data.data) },
} }
}), }),
)), )),
@ -73,7 +74,7 @@ impl Handle {
22 => todo!("Event::PropertyChange"), 22 => todo!("Event::PropertyChange"),
24 => todo!("Event::QueueOverflow"), 24 => todo!("Event::QueueOverflow"),
25 => todo!("Event::Hook"), 25 => todo!("Event::Hook"),
_ => Event::Ignore(event.event_id), _ => Some(Event::Ignore(event.event_id)),
} }
} }
} }
@ -132,15 +133,15 @@ impl<'a> FormatData<'a> {
} }
pub struct EventProperty<'a> { pub struct EventProperty<'a> {
name: &'a str, pub name: &'a str,
value: FormatData<'a>, pub value: FormatData<'a>,
} }
pub struct EventLogMessage<'a> { pub struct EventLogMessage<'a> {
prefix: &'a str, pub prefix: &'a str,
level: &'a str, pub level: &'a str,
text: &'a str, pub text: &'a str,
log_level: i32, pub log_level: i32,
} }
pub enum EndFileReason { pub enum EndFileReason {