From 69fbc374b91bed08e697da4c94b167a961f410b6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 22:19:48 +0000 Subject: [PATCH] voelin-media: the decoder order test with dav1d built in AV1 comes first in the viewer's order, so with the av1 feature on by default the first decoders are not VP9 and VP8 any more; the test checks their order among themselves and what leads. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VZBWxxMsxUzp4PSTKVzbZN --- crates/voelin-media/src/codec/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/voelin-media/src/codec/mod.rs b/crates/voelin-media/src/codec/mod.rs index e3378b0..458115a 100644 --- a/crates/voelin-media/src/codec/mod.rs +++ b/crates/voelin-media/src/codec/mod.rs @@ -1060,7 +1060,17 @@ mod tests { assert!(codecs.new_decoder(Codec::H265).is_err()); #[cfg(feature = "vpx")] { - assert_eq!(codecs.decoders()[..2], [Codec::Vp9, Codec::Vp8]); + // AV1 (dav1d, feature `av1`) comes first where it is built in. + let vpx: Vec<_> = codecs + .decoders() + .into_iter() + .filter(|c| matches!(c, Codec::Vp8 | Codec::Vp9)) + .collect(); + assert_eq!(vpx, [Codec::Vp9, Codec::Vp8]); + assert_eq!( + codecs.decoders()[0], + if cfg!(feature = "av1") { Codec::Av1 } else { Codec::Vp9 } + ); assert_eq!(codecs.encoder_codecs()[0], Codec::Vp8); assert_eq!(codecs.pick_encoder(&[Codec::H264, Codec::Vp9]), Some(Codec::Vp9)); assert_eq!(codecs.pick_encoder(&[Codec::Vp8, Codec::Vp9]), Some(Codec::Vp8));