From: Kostya Shishkov Date: Thu, 15 Jun 2023 16:48:38 +0000 (+0200) Subject: stop decoding on I/O error X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=6a5b710289ae910ad5518a24c133b0b80ec9da82;p=nihav-player.git stop decoding on I/O error --- 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 {