Let the cancel-walk test skip fixtures the video demuxer refuses
Browse files at this commit4257e493257c287ca1e7af5c673560cd0c0aabb0Parent: 44547fa- test
- let the cancel-walk test skip fixtures the video demuxer refuses
1 changed file +6 -2
crates/engine/src/demux.rsmodified+6 -2
| @@ -4201,12 +4201,16 @@ mod tests { | |||
| 4201 | /// about the file -- and the same walk without it still opens. | 4201 | /// about the file -- and the same walk without it still opens. |
| 4202 | #[test] | 4202 | #[test] |
| 4203 | fn a_cancelled_walk_gives_up_and_says_so() { | 4203 | fn a_cancelled_walk_gives_up_and_says_so() { |
| 4204 | - let Some(path) = matroska_fixtures().into_iter().next() else { | 4204 | + // The first fixture the *video* demuxer accepts: the sweep also finds |
| 4205 | + // audio-only `.mka`, which `MkvDemuxer::open` rightly refuses. | ||
| 4206 | + let Some((path, lazy)) = matroska_fixtures() | ||
| 4207 | + .into_iter() | ||
| 4208 | + .find_map(|p| MkvDemuxer::open(&p).ok().map(|(_, lazy)| (p, lazy))) | ||
| 4209 | + else { | ||
| 4205 | eprintln!("no Matroska fixture: the cancel walk is not measured"); | 4210 | eprintln!("no Matroska fixture: the cancel walk is not measured"); |
| 4206 | return; | 4211 | return; |
| 4207 | }; | 4212 | }; |
| 4208 | let name = path.file_name().unwrap().to_string_lossy().into_owned(); | 4213 | let name = path.file_name().unwrap().to_string_lossy().into_owned(); |
| 4209 | - let (_, lazy) = MkvDemuxer::open(&path).expect(&name); | ||
| 4210 | let (segment, number) = (lazy.segment, lazy.number); | 4214 | let (segment, number) = (lazy.segment, lazy.number); |
| 4211 | let mut file = File::open(&path).expect(&name); | 4215 | let mut file = File::open(&path).expect(&name); |
| 4212 | 4216 | ||