X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-registry%2Fsrc%2Fdetect.rs;h=f10b76e931bb43e18f38d7689094fb9021b98d62;hb=f84608b7a3c16f682ef9418feddf5b523799e053;hp=6f67fbd7253502f17f82a212d8bfce2a6eb531a0;hpb=55d852316872154db020827bd833fff7d5b49604;p=nihav.git diff --git a/nihav-registry/src/detect.rs b/nihav-registry/src/detect.rs index 6f67fbd..f10b76e 100644 --- a/nihav-registry/src/detect.rs +++ b/nihav-registry/src/detect.rs @@ -220,11 +220,27 @@ const DETECTORS: &[DetectConditions] = &[ &CC::Str(b"moov")), &CC::Str(b"ftyp")) }], }, + DetectConditions { + demux_name: "fcmp", + extensions: ".cmp", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"FCMP")}], + }, + DetectConditions { + demux_name: "fst", + extensions: ".fst", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"2TSF")}], + }, DetectConditions { demux_name: "gdv", extensions: ".gdv", conditions: &[CheckItem{offs: 0, cond: &CC::Eq(Arg::U32LE(0x29111994))}], }, + DetectConditions { + demux_name: "fable-imax", + extensions: ".imx", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"IMAX") }, + CheckItem{offs: 10, cond: &CC::Eq(Arg::U16LE(0x102)) }], + }, DetectConditions { demux_name: "realaudio", extensions: ".ra,.ram", @@ -254,6 +270,28 @@ const DETECTORS: &[DetectConditions] = &[ extensions: ".smk", conditions: &[CheckItem{offs: 0, cond: &CC::Or(&CC::Str(b"SMK2"), &CC::Str(b"SMK4"))}], }, + DetectConditions { + demux_name: "ape", + extensions: ".ape", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"MAC ") }, + CheckItem{offs: 4, cond: &CC::In(Arg::U16LE(3800), Arg::U16LE(3990))}], + }, + DetectConditions { + demux_name: "flac", + extensions: ".flac", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"fLaC") }], + }, + DetectConditions { + demux_name: "tta", + extensions: ".tta", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"TTA1") }], + }, + DetectConditions { + demux_name: "wavpack", + extensions: ".wv", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"wvpk") }, + CheckItem{offs: 8, cond: &CC::In(Arg::U16LE(0x402), Arg::U16LE(0x410))}], + }, DetectConditions { demux_name: "vivo", extensions: ".viv", @@ -338,7 +376,7 @@ pub fn detect_format(name: &str, src: &mut ByteReader) -> Option<(&'static str, } /// Tries to detect container format for provided file name. -pub fn detect_format_by_name(name: &str) -> Option<(&'static str)> { +pub fn detect_format_by_name(name: &str) -> Option<&'static str> { if name.is_empty() { return None; }