From 6a5b710289ae910ad5518a24c133b0b80ec9da82 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 15 Jun 2023 18:48:38 +0200 Subject: [PATCH] stop decoding on I/O error --- videoplayer/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/videoplayer/src/main.rs b/videoplayer/src/main.rs index ca11d87..a3c7f43 100644 --- a/videoplayer/src/main.rs +++ b/videoplayer/src/main.rs @@ -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 { -- 2.39.5