diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2019-01-31 14:23:39 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2019-01-31 14:23:39 +0100 |
commit | 4d477e238a982a986a8e32f23b405ff82b3feb41 (patch) | |
tree | 39c745789afb5e311cd031ffa21dfcf092b874fb /nihav-core/src | |
parent | ef1d2014441deb8c142ecce64fbed2ca0958f1b5 (diff) | |
download | nihav-4d477e238a982a986a8e32f23b405ff82b3feb41.tar.gz |
fix detection module and Bink2 extension
Diffstat (limited to 'nihav-core/src')
-rw-r--r-- | nihav-core/src/detect.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nihav-core/src/detect.rs b/nihav-core/src/detect.rs index 8308ba8..0285e64 100644 --- a/nihav-core/src/detect.rs +++ b/nihav-core/src/detect.rs @@ -134,7 +134,7 @@ impl<'a> CC<'a> { match *self { CC::Or (ref a, ref b) => { a.eval(src) || b.eval(src) }, CC::Eq(ref arg) => { arg.eq(src) }, - CC::In(ref a, ref b) => { a.le(src) && b.ge(src) }, + CC::In(ref a, ref b) => { a.ge(src) && b.le(src) }, CC::Lt(ref arg) => { arg.lt(src) }, CC::Le(ref arg) => { arg.le(src) }, CC::Gt(ref arg) => { arg.gt(src) }, @@ -195,7 +195,7 @@ const DETECTORS: &[DetectConditions] = &[ }, DetectConditions { demux_name: "bink", - extensions: ".bik,.kb2", + extensions: ".bik,.bk2", conditions: &[CheckItem{offs: 0, cond: &CC::Or(&CC::In(Arg::U32BE(0x32494B62), // BIKb Arg::U32BE(0x32494B7B)), // BIKz &CC::In(Arg::U32BE(0x4B423261), // KB2a @@ -244,9 +244,9 @@ pub fn detect_format(name: &str, src: &mut ByteReader) -> Option<(&'static str, if score == DetectionScore::MagicMatches { return Some((detector.demux_name, score)); } - if let None = result { + if result.is_none() && score != DetectionScore::No { result = Some((detector.demux_name, score)); - } else { + } else if result.is_some() { let (_, oldsc) = result.unwrap(); if oldsc.less(score) { result = Some((detector.demux_name, score)); |