summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2023-06-18 16:16:54 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2023-06-18 16:16:54 +0200
commit364f01a375903b90fc9b0af001a0808249aabac3 (patch)
treebc2b9330a93a6a6b9e0d83d53ff335606df95e27
parent54ede18180302b14e7de9cc033d1be66592db796 (diff)
downloadnihav-player-364f01a375903b90fc9b0af001a0808249aabac3.tar.gz
improve error handling in video decoding a bit
-rw-r--r--videoplayer/src/videodec.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/videoplayer/src/videodec.rs b/videoplayer/src/videodec.rs
index d30f45f..1d70112 100644
--- a/videoplayer/src/videodec.rs
+++ b/videoplayer/src/videodec.rs
@@ -113,17 +113,20 @@ impl VideoDecoder {
},
(Err(err), id) => {
reord.drop_frame(id);
- panic!("frame {} decoding error {:?}", id, err);
+ println!("frame {} decoding error {:?}", id, err);
},
};
}
match vdec.queue_pkt(&mut self.dec.dsupp, &pkt, queue_id) {
Ok(true) => {},
- Ok(false) => panic!("still can't queue frame!"),
- Err(err) => panic!("queueing error {:?}", err),
+ Ok(false) => {
+ println!("still can't queue frame!");
+ VDEC_STATE.set_state(DecodingState::Error);
+ },
+ Err(err) => println!("queueing error {:?}", err),
};
},
- Err(err) => panic!("queueing error {:?}", err),
+ Err(err) => println!("queueing error {:?}", err),
};
while let Some(frm) = reord.get_frame() {
let bt = frm.get_buffer();
@@ -156,7 +159,7 @@ impl VideoDecoder {
},
(Err(err), id) => {
reord.drop_frame(id);
- panic!("frame {} decoding error {:?}", id, err);
+ println!("frame {} decoding error {:?}", id, err);
},
};
}
@@ -168,7 +171,7 @@ impl VideoDecoder {
(Err(DecoderError::NoFrame), _) => {},
(Err(err), id) => {
reord.drop_frame(id);
- panic!("frame {} decoding error {:?}", id, err);
+ println!("frame {} decoding error {:?}", id, err);
},
};
}