make muxers handle options
[nihav.git] / nihav-commonfmt / src / muxers / avi.rs
index d47aac3570685d70464369ea897f81f23168a8e6..9b83296db938123f8609bbbc542a1c3fee720316 100644 (file)
@@ -202,8 +202,7 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> {
                     if twocc.is_none() {
                         return Err(MuxerError::UnsupportedFormat);
                     }
-                    let twocc = twocc.unwrap_or(0);
-                    self.bw.write_u16le(if twocc == 0 { 1 } else { twocc })?; // PCM hack
+                    self.bw.write_u16le(twocc.unwrap_or(0))?;
                     self.bw.write_u16le(ainfo.channels as u16)?;
                     self.bw.write_u32le(ainfo.sample_rate)?;
                     self.bw.write_u32le(0)?; // avg bytes per second
@@ -289,6 +288,12 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> {
     }
 }
 
+impl<'a> NAOptionHandler for AVIMuxer<'a> {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub struct AVIMuxerCreator {}
 
 impl MuxerCreator for AVIMuxerCreator {
@@ -296,6 +301,7 @@ impl MuxerCreator for AVIMuxerCreator {
         Box::new(AVIMuxer::new(bw))
     }
     fn get_name(&self) -> &'static str { "avi" }
+    fn get_capabilities(&self) -> MuxerCapabilities { MuxerCapabilities::Universal }
 }
 
 #[cfg(test)]