From d04b63e8667d71f53ebbe5dec05eb1b5f283b176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 25 Aug 2026 09:17:00 +0300 Subject: [PATCH] test(h265): take the clip's dimensions by position ffprobe prints one comma-separated line per stream and recent builds end it with a trailing separator, so splitting the line in two handed the parse a field with a comma still on it and every clip-driven gate panicked before it measured anything. --- crates/ec-h265/tests/encode.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/ec-h265/tests/encode.rs b/crates/ec-h265/tests/encode.rs index 4d32e1b0..5d931c99 100644 --- a/crates/ec-h265/tests/encode.rs +++ b/crates/ec-h265/tests/encode.rs @@ -740,11 +740,17 @@ fn clip_sources(path: &std::ffi::OsStr, want: usize) -> (usize, usize, Vec().ok()?, h.parse::().ok()?))) - .expect("ffprobe returned dimensions"); + // ffprobe prints one comma-separated line per stream, and recent builds + // end it with a trailing separator, so the fields are taken by position + // rather than by splitting the line in two. + let mut fields = csv.lines().next().unwrap_or_default().split(','); + let (w, h) = (|| { + Some(( + fields.next()?.trim().parse::().ok()?, + fields.next()?.trim().parse::().ok()?, + )) + })() + .unwrap_or_else(|| panic!("ffprobe returned dimensions, got {csv:?}")); // Pictures to pass over before sampling: the head of a film is titles and // fades, which are not what a codec is measured on. let skip: usize = std::env::var("EC_H265_CLIP_SKIP")