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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VZBWxxMsxUzp4PSTKVzbZN
This commit is contained in:
Claude committed 2026-10-04 22:19:48 +00:00
1 parent af53a3cd62
commit d26cb20a40
1 file changed
+11 -1
+11 -1
View File
@@ -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));