make validate!() print message only in debug builds
[nihav.git] / nihav-vivo / src / demuxers / mod.rs
index c76f1062bf8e7d67b91e8ed99b8ca2d9d0437369..145dafc277893e9585a82fa122485f78f885f956 100644 (file)
@@ -2,14 +2,19 @@ use nihav_core::demuxers::*;
 
 
 #[allow(unused_macros)]
+#[cfg(debug_assertions)]
 macro_rules! validate {
     ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
 }
+#[cfg(not(debug_assertions))]
+macro_rules! validate {
+    ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } };
+}
 
 #[cfg(feature="demuxer_vivo")]
 mod vivo;
 
-const DEMUXERS: &[&DemuxerCreator] = &[
+const DEMUXERS: &[&dyn DemuxerCreator] = &[
 #[cfg(feature="demuxer_vivo")]
     &vivo::VivoDemuxerCreator {},
 ];