Bug 1195723: [adts] P4. Add extra mimetype for adts/aac. r?kamidphish draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 17 Aug 2016 15:25:02 +1000
changeset 404113 4bb44f35b2f6f6792464bdcfac917c920682985c
parent 404112 4b81c49f90233885c494df0e3c6bcf244532a1b6
child 404114 cd090eb92505d68b0206a7b8a342b5fd402bee16
push id27118
push userbmo:jyavenard@mozilla.com
push dateMon, 22 Aug 2016 22:58:57 +0000
reviewerskamidphish
bugs1195723
milestone51.0a1
Bug 1195723: [adts] P4. Add extra mimetype for adts/aac. r?kamidphish When the content is served by Apache, a file with an .aac extension always see its Content-Type set to x-aacp. MozReview-Commit-ID: 65NANlKNQek
dom/media/ADTSDecoder.cpp
dom/media/ADTSDecoder.h
--- a/dom/media/ADTSDecoder.cpp
+++ b/dom/media/ADTSDecoder.cpp
@@ -36,16 +36,17 @@ ADTSDecoder::IsEnabled()
   return platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/mp4a-latm"),
                                     /* DecoderDoctorDiagnostics* */ nullptr);
 }
 
 /* static */ bool
 ADTSDecoder::CanHandleMediaType(const nsACString& aType,
                                 const nsAString& aCodecs)
 {
-  if (aType.EqualsASCII("audio/aac") || aType.EqualsASCII("audio/aacp")) {
+  if (aType.EqualsASCII("audio/aac") || aType.EqualsASCII("audio/aacp") ||
+      aType.EqualsASCII("audio/x-aac")) {
     return IsEnabled() && (aCodecs.IsEmpty() || aCodecs.EqualsASCII("aac"));
   }
 
   return false;
 }
 
 } // namespace mozilla
--- a/dom/media/ADTSDecoder.h
+++ b/dom/media/ADTSDecoder.h
@@ -13,17 +13,17 @@ namespace mozilla {
 
 class ADTSDecoder : public MediaDecoder {
 public:
   // MediaDecoder interface.
   explicit ADTSDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
   MediaDecoder* Clone(MediaDecoderOwner* aOwner) override;
   MediaDecoderStateMachine* CreateStateMachine() override;
 
-  // Returns true if the MP3 backend is pref'ed on, and we're running on a
+  // Returns true if the ADTS backend is pref'ed on, and we're running on a
   // platform that is likely to have decoders for the format.
   static bool IsEnabled();
   static bool CanHandleMediaType(const nsACString& aType,
                                  const nsAString& aCodecs);
 };
 
 } // namespace mozilla