]> git.nihav.org Git - nihav-player.git/commitdiff
stop decoding on I/O error
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 15 Jun 2023 16:48:38 +0000 (18:48 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 15 Jun 2023 16:48:38 +0000 (18:48 +0200)
videoplayer/src/main.rs

index ca11d87905d01ae1be03b7472c929a0148f9dd4d..a3c7f4361a78837c497aaad10aa170c9ee2cbfbd 100644 (file)
@@ -689,7 +689,14 @@ impl Player {
                             self.acontrol.try_send_audio(PktSendEvent::End);
                             has_data = false;
                         },
-                        Err(err) => { println!("demuxer error {:?}", err); },
+                        Err(err) => {
+                            println!("demuxer error {:?}", err);
+                            if err == DemuxerError::IOError {
+                                self.vcontrol.try_send_video(PktSendEvent::End);
+                                self.acontrol.try_send_audio(PktSendEvent::End);
+                                has_data = false;
+                            }
+                        },
                         Ok(pkt) => {
                             let streamno = pkt.get_stream().get_id();
                             if self.has_video && streamno == self.video_str {