Bug 1251184: [quicktime] P1. Report video/quicktime mimetype when sniffing. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 11 Mar 2016 22:32:30 +1100
changeset 288686 556446426ca25a592e6596d2de05ec636997c597
parent 288685 8732ddfbff87d14bc516db2ab016405385472ef6
child 288687 523aa849f21fc1793460ac1af5452135b941a3c9
push id18174
push usercbook@mozilla.com
push dateTue, 15 Mar 2016 09:44:58 +0000
treeherderfx-team@dd0baa33759d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1251184
milestone48.0a1
Bug 1251184: [quicktime] P1. Report video/quicktime mimetype when sniffing. r=cpearce MozReview-Commit-ID: 9EJQVYt76Mh
netwerk/mime/nsMimeTypes.h
toolkit/components/mediasniffer/nsMediaSniffer.cpp
--- a/netwerk/mime/nsMimeTypes.h
+++ b/netwerk/mime/nsMimeTypes.h
@@ -146,16 +146,17 @@
 #define TEXT_ECMASCRIPT                     "text/ecmascript"
 #define TEXT_JAVASCRIPT                     "text/javascript"
 #define TEXT_XSL                            "text/xsl"
 #define TEXT_EVENT_STREAM                   "text/event-stream"
 #define TEXT_CACHE_MANIFEST                 "text/cache-manifest"
 
 #define VIDEO_MPEG                          "video/mpeg"
 #define VIDEO_MP4                           "video/mp4"
+#define VIDEO_QUICKTIME                     "video/quicktime"
 #define VIDEO_RAW                           "video/x-raw-yuv"
 #define VIDEO_OGG                           "video/ogg"
 #define VIDEO_WEBM                          "video/webm"
 #define VIDEO_3GPP                          "video/3gpp"
 #define VIDEO_3GPP2                         "video/3gpp2"
 #define VIDEO_MPEG_TS                       "video/mp2t"
 #define VIDEO_AVI                           "video/avi"
 #define VIDEO_MATROSKA                      "video/x-matroska"
--- a/toolkit/components/mediasniffer/nsMediaSniffer.cpp
+++ b/toolkit/components/mediasniffer/nsMediaSniffer.cpp
@@ -38,17 +38,17 @@ nsMediaSnifferEntry nsMediaSniffer::sSni
 
 // For a complete list of file types, see http://www.ftyps.com/index.html
 nsMediaSnifferEntry sFtypEntries[] = {
   PATTERN_ENTRY("\xFF\xFF\xFF", "mp4", VIDEO_MP4), // Could be mp41 or mp42.
   PATTERN_ENTRY("\xFF\xFF\xFF", "avc", VIDEO_MP4), // Could be avc1, avc2, ...
   PATTERN_ENTRY("\xFF\xFF\xFF", "3gp", VIDEO_3GPP), // Could be 3gp4, 3gp5, ...
   PATTERN_ENTRY("\xFF\xFF\xFF\xFF", "M4A ", AUDIO_MP4),
   PATTERN_ENTRY("\xFF\xFF\xFF\xFF", "M4P ", AUDIO_MP4),
-  PATTERN_ENTRY("\xFF\xFF\xFF\xFF", "qt  ", VIDEO_MP4),
+  PATTERN_ENTRY("\xFF\xFF\xFF\xFF", "qt  ", VIDEO_QUICKTIME),
 };
 
 static bool MatchesBrands(const uint8_t aData[4], nsACString& aSniffedType)
 {
   for (size_t i = 0; i < mozilla::ArrayLength(sFtypEntries); ++i) {
     const auto& currentEntry = sFtypEntries[i];
     bool matched = true;
     MOZ_ASSERT(currentEntry.mLength <= 4, "Pattern is too large to match brand strings.");