use osd::*;
#[repr(u8)]
-#[derive(Clone,Copy,Debug,PartialEq)]
+#[derive(Clone,Copy,Debug,PartialEq,Default)]
enum DecodingState {
+ #[default]
Normal,
Waiting,
Flush,
End,
}
-impl Default for DecodingState {
- fn default() -> Self { DecodingState::Normal }
-}
-
impl From<u8> for DecodingState {
fn from(val: u8) -> Self {
match val {
println!("failed to open {}", name);
return;
};
- let dmx_fact;
let mut fr = FileReader::new_read(&mut file);
let mut br = ByteReader::new(&mut fr);
let res = detect::detect_format(name, &mut br);
println!("error finding {} demuxer", dmx_name);
return;
}
- dmx_fact = ret.unwrap();
+ let dmx_fact = ret.unwrap();
br.seek(SeekFrom::Start(0)).expect("should be able to seek to the start");
let ret = create_demuxer(dmx_fact, &mut br);
if ret.is_err() {
let fname = path.file_name();
let wname = if let Some(fname) = fname {
- "NihAV player - ".to_owned() + fname.to_str().expect("should be able to set window title")
+ // workaround for libSDL2 workaround for non-UTF8 windowing systems
+ // see https://github.com/libsdl-org/SDL/pull/4290 for detais
+ let nname = fname.to_str().expect("should be able to set window title").replace('\u{2013}', "-");
+ "NihAV player - ".to_owned() + &nname
} else {
"NihAV player".to_owned()
};