From 6358d3162bcf54802a28a5a49b90d882e3d6d83e Mon Sep 17 00:00:00 2001 From: David Wendt Date: Sat, 15 Apr 2023 18:34:45 -0400 Subject: [PATCH] flv: The type flag bits in the FLV spec are written backwards. --- flv/src/header.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flv/src/header.rs b/flv/src/header.rs index 0db382416..6090ca311 100644 --- a/flv/src/header.rs +++ b/flv/src/header.rs @@ -5,8 +5,8 @@ use std::io::{Seek, SeekFrom}; bitflags! { #[derive(PartialEq, Eq, Debug, Clone, Copy)] pub struct TypeFlags: u8 { - const HAS_AUDIO = 0b1000_0000; - const HAS_VIDEO = 0b0010_0000; + const HAS_AUDIO = 0b0000_0001; + const HAS_VIDEO = 0b0000_0100; } } @@ -59,7 +59,7 @@ mod tests { #[test] fn read_header() { - let data = [0x46, 0x4C, 0x56, 0x01, 0xA0, 0x12, 0x34, 0x56, 0x78]; + let data = [0x46, 0x4C, 0x56, 0x01, 0x05, 0x12, 0x34, 0x56, 0x78]; let mut reader = FlvReader::from_source(&data); assert_eq!(