print duration if available
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 4 Oct 2020 10:48:59 +0000 (12:48 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 4 Oct 2020 10:48:59 +0000 (12:48 +0200)
src/main.rs

index cbd17d327ebe0769f92621b3cb30860a460c5090..c6875fb45b232d41b33c05af97ddc0036a5d7e5a 100644 (file)
@@ -197,6 +197,13 @@ println!(" seek error {:?}", ret.err().unwrap());
     let mut sids: Vec<u32> = Vec::new();
     let mut writers: Vec<Outputter> = Vec::new();
     let dec_opts = [NAOption{name: FRAME_SKIP_OPTION, value: NAValue::String(smode.to_string())}];
     let mut sids: Vec<u32> = Vec::new();
     let mut writers: Vec<Outputter> = Vec::new();
     let dec_opts = [NAOption{name: FRAME_SKIP_OPTION, value: NAValue::String(smode.to_string())}];
+    let duration = dmx.get_duration();
+    if duration != 0 {
+        let s = duration / 1000;
+        let m = s / 60;
+        let h = m / 60;
+        println!(" total duration {}:{:02}:{:02}.{}", h, m % 60, s % 60, (duration / 100) % 10);
+    }
     for i in 0..dmx.get_num_streams() {
         let s = dmx.get_stream(i).unwrap();
         let info = s.get_info();
     for i in 0..dmx.get_num_streams() {
         let s = dmx.get_stream(i).unwrap();
         let info = s.get_info();