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
--- 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