From a2c67d215ac5cd0b2d2ae3472086524f74d2c638 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 14 Feb 2026 20:42:12 +0100 Subject: [PATCH] videoplayer: limit prefill iterations in case something goes wrong --- videoplayer/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/videoplayer/src/main.rs b/videoplayer/src/main.rs index 83e162b..b06cb53 100644 --- a/videoplayer/src/main.rs +++ b/videoplayer/src/main.rs @@ -571,7 +571,8 @@ impl Player { debug_log!(self; {" prefilling"}); let mut got_video = !self.has_video; let mut got_audio = !self.has_audio; - while !(got_video && got_audio) { + let mut iters = 0; + while !(got_video && got_audio) && iters < 10 { // phase 1 - try to send packets for decoding loop { let mut try_send = self.acontrol.get_queue_size() < FRAME_QUEUE_LEN && (!self.has_video || (!self.vcontrol.is_filled(FRAME_QUEUE_LEN) && !disp_queue.is_full())); @@ -622,6 +623,7 @@ impl Player { if self.has_audio && self.acontrol.get_fill() > 0 { got_audio = true; } + iters += 1; } debug_log!(self; {format!(" prefilling done, frames {}-{} audio {}", disp_queue.start, disp_queue.end, self.acontrol.get_fill())}); Ok(()) -- 2.39.5