]> git.nihav.org Git - nihav-encoder.git/commitdiff
do not attempt to synchronise packets when some of them lack timestamps
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 22 Mar 2025 15:00:47 +0000 (16:00 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 22 Mar 2025 15:00:47 +0000 (16:00 +0100)
src/transcoder.rs

index b11ba12d4e8b3406218e7cb32d74f759a27bd344..bf054f2336c4a78f83aa44f4717de4d469bb39bd 100644 (file)
@@ -354,7 +354,12 @@ impl OutputQueue {
                     all_with_time = false;
                 }
             }
-            if all_with_time && min_ts.is_some() {
+            if !all_with_time {
+                println!("Some packets do not have time set, synchronisation is not possible!");
+                self.sync = false;
+                return self.get_last_packet();
+            }
+            if min_ts.is_some() {
                 self.packets[min_sn].pop_front()
             } else {
                 self.get_last_packet()