]> git.nihav.org Git - nihav-player.git/commitdiff
hwdec_vaapi: allow H.264 configuration data without 'avcC' prefix master
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 31 Oct 2026 14:59:15 +0000 (15:59 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 31 Oct 2026 14:59:15 +0000 (15:59 +0100)
hwdec-vaapi/src/h264/mod.rs

index 08e6ed6a1ee4e58da98342178c97efcac7658e98..3b1718bf64117151bb01e428373ec4d14bc2006d 100644 (file)
@@ -241,10 +241,12 @@ impl HWDecoderCore for VaapiH264Decoder {
 //print!("edata:"); for &el in edata.iter() { print!(" {:02X}", el); } println!();
             let profile;
             let mut nal_buf = Vec::with_capacity(1024);
-            if edata.len() > 11 && &edata[0..4] == b"avcC" {
+            if edata.len() > 7 {
                 let mut br = MemoryReader::new_read(edata.as_slice());
 
+                if &edata[0..4] == b"avcC" {
                                           br.read_skip(4)?;
+                }
                 let version             = br.read_byte()?;
                 validate!(version == 1);
                 profile                 = br.read_byte()?;