]> git.nihav.org Git - nihav-player.git/commitdiff
videoplayer: fix some PTS/DTS confusion master
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 26 Feb 2026 17:44:14 +0000 (18:44 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 26 Feb 2026 17:44:14 +0000 (18:44 +0100)
videoplayer/src/videodec.rs

index b8add27f33b3dd6fc1037ed8cd09edbda4206c34..4ed9b9516afb465fe08fd4df63983bf9d0610a32 100644 (file)
@@ -96,7 +96,7 @@ impl VideoDecoder {
                     while let Some(frm) = reord.get_frame() {
                         let bt = frm.get_buffer();
                         if let NABufferType::None = bt { continue; }
-                        let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                        let ts = frm.get_pts().unwrap_or(0);
                         return self.convert_buf(bt, ts);
                     }
                 }
@@ -133,7 +133,7 @@ impl VideoDecoder {
                 while let Some(frm) = reord.get_frame() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -143,7 +143,7 @@ impl VideoDecoder {
                 while let Some(frm) = vdec.get_frame() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -157,7 +157,7 @@ impl VideoDecoder {
                 while let Some(frm) = reord.get_frame() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -194,7 +194,7 @@ impl VideoDecoder {
                 while let Some(frm) = reord.get_frame() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -203,7 +203,7 @@ impl VideoDecoder {
                 while let Some(frm) = vdec.get_frame() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -217,7 +217,7 @@ impl VideoDecoder {
                 while let Some(frm) = reord.get_last_frames() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -225,7 +225,7 @@ impl VideoDecoder {
                 while let Some(frm) = reord.get_last_frames() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },
@@ -234,7 +234,7 @@ impl VideoDecoder {
                 while let Some(frm) = dec.get_last_frames() {
                     let bt = frm.get_buffer();
                     if let NABufferType::None = bt { continue; }
-                    let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+                    let ts = frm.get_pts().unwrap_or(0);
                     return self.convert_buf(bt, ts);
                 }
             },