duck/vp56: select proper format for VP6 alpha
[nihav.git] / nihav-duck / src / codecs / vp6.rs
index 4bbe61fbe7031058cebabec741089fda7bd3b479..97986340a06ab5bc2e464da1280f6f73c7b71b84 100644 (file)
@@ -51,6 +51,7 @@ impl VP56Parser for VP6BR {
         } else {
             hdr.version = self.vpversion;
             hdr.profile = self.profile;
+            hdr.interlaced = self.interlaced;
         }
         if hdr.multistream || (hdr.profile == VP6_SIMPLE_PROFILE) {
             hdr.offset                          = br.read(16)? as u16;
@@ -687,13 +688,7 @@ impl NADecoder for VP6Decoder {
             let fmt = if !self.has_alpha {
                     YUV420_FORMAT
                 } else {
-                    NAPixelFormaton::new(ColorModel::YUV(YUVSubmodel::YUVJ),
-                                         Some(NAPixelChromaton::new(0, 0, false, 8, 0, 0, 1)),
-                                         Some(NAPixelChromaton::new(1, 1, false, 8, 0, 1, 1)),
-                                         Some(NAPixelChromaton::new(1, 1, false, 8, 0, 2, 1)),
-                                         Some(NAPixelChromaton::new(0, 0, false, 8, 0, 3, 1)),
-                                         None,
-                                         0, 4)
+                    VP_YUVA420_FORMAT
                 };
             let myvinfo = NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, fmt);
             let myinfo = NACodecTypeInfo::Video(myvinfo.clone());