add declared bitdepth to NAVideoInfo
[nihav.git] / nihav-commonfmt / src / demuxers / avi.rs
index 4ea40673aa40c2be22249d453ea7bc8552857278..11f0bce5d1dfcb55c84e6022982ba2b5e42fd83b 100644 (file)
@@ -154,6 +154,12 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> {
     }
 }
 
+impl<'a> NAOptionHandler for AVIDemuxer<'a> {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 impl<'a> AVIDemuxer<'a> {
     fn new(io: &'a mut ByteReader<'a>) -> Self {
         AVIDemuxer {
@@ -409,7 +415,8 @@ fn parse_strf_vids(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize
 
     let flip = height < 0;
     let format = if bitcount > 8 { RGB24_FORMAT } else { PAL8_FORMAT };
-    let vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format);
+    let mut vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format);
+    vhdr.bits = (planes as u8) * (bitcount as u8);
     let vci = NACodecTypeInfo::Video(vhdr);
     let edata = dmx.read_extradata(size - 40)?;
     if colors > 0 {