From ebc3484d4873fafc28ab5b452f6d10b4bd9476e2 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 5 Nov 2026 00:34:18 -0800 Subject: [PATCH] fix(scene): retire the replaced rendition cleanly in a_replacement_track_keeps_its_delay The test dropped the old video producer unfinished, which aborts its track. The source fails on that abort when it reaches the old decoder before the catalog naming the replacement does, and then waits forever for a picture. Co-Authored-By: Claude Opus 5.5 --- rs/moq-scene/src/source.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rs/moq-scene/src/source.rs b/rs/moq-scene/src/source.rs index 8841e29..4bf601d 100644 --- a/rs/moq-scene/src/source.rs +++ b/rs/moq-scene/src/source.rs @@ -1925,7 +1925,12 @@ mod tests { ) .unwrap(); let (video, mut encoder) = rendition(&live.broadcast, timebase).await; - drop(std::mem::replace(&mut live.video, video)); + // Finished before it goes, as a publisher retires a rendition: one + // dropped unfinished aborts its track, which fails the source if + // that reaches it before the catalog naming the replacement does. + let mut old = std::mem::replace(&mut live.video, video); + old.finish().unwrap(); + drop(old); until_time(kio::clock::now()).await; let arrived = kio::clock::now(); picture(&mut live.video, &mut encoder, 0);