aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-01-03 16:28:47 +0100
committerdec05eba <dec05eba@protonmail.com>2021-01-03 16:28:47 +0100
commit9d07e4df1792a3b5a28b41a4dfc47da875d00546 (patch)
tree2538ebac20b9c81f0378aa542d19f4cbff7ab549 /src
parent41c55610d9701ce6bafb475babfa03186e9b961b (diff)
Support ftypqt mp4 files
Diffstat (limited to 'src')
-rw-r--r--src/FileAnalyzer.cpp3
-rw-r--r--src/QuickMedia.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp
index 8d5eae8..b397def 100644
--- a/src/FileAnalyzer.cpp
+++ b/src/FileAnalyzer.cpp
@@ -20,12 +20,13 @@ namespace QuickMedia {
// What about audio ogg files that are not opus?
// TODO: Test all of these
- static const std::array<MagicNumber, 22> magic_numbers = {
+ static const std::array<MagicNumber, 23> magic_numbers = {
MagicNumber{ {'R', 'I', 'F', 'F', -1, -1, -1, -1, 'A', 'V', 'I', ' '}, 12, ContentType::VIDEO_AVI },
MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'p', 'i', 's', 'o', 'm'}, 12, ContentType::VIDEO_MP4 },
MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'p', 'm', 'p', '4', '2'}, 12, ContentType::VIDEO_MP4 },
MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'm', 'p', '4', '2'}, 11, ContentType::VIDEO_MP4 },
MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', '3', 'g', 'p', '5'}, 11, ContentType::VIDEO_MP4 },
+ MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'p', 'q', 't'}, 10, ContentType::VIDEO_MP4 },
MagicNumber{ {0x1A, 0x45, 0xDF, 0xA3}, 4, ContentType::VIDEO_WEBM },
MagicNumber{ {'.', 's', 'n', 'd'}, 4, ContentType::AUDIO_BASIC },
MagicNumber{ {'F', 'O', 'R', 'M', -1, -1, -1, -1, 'A', 'I', 'F', 'F'}, 12, ContentType::AUDIO_AIFF },
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 6be302c..192be5c 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1564,7 +1564,7 @@ namespace QuickMedia {
const char *args[] = { "curl", "-sLf", "-r", "0-40", "-H", useragent_str, "--", url, nullptr };
exec_program(args, accumulate_string_limit_head, &result, 42);
return (result.size() >= 42)
- && (memcmp(&result[4], "ftypisom", 8) == 0 || memcmp(&result[4], "ftypmp42", 8) == 0 || memcmp(&result[4], "ftymp42", 7) == 0 || memcmp(&result[4], "fty3gp5", 7) == 0)
+ && (memcmp(&result[4], "ftypisom", 8) == 0 || memcmp(&result[4], "ftypmp42", 8) == 0 || memcmp(&result[4], "ftymp42", 7) == 0 || memcmp(&result[4], "fty3gp5", 7) == 0 || memcmp(&result[4], "ftypqt", 6) == 0)
&& (memmem(&result[0], result.size(), "moov", 4) == NULL);
}