Bug 1248570: Allow WAV into media element. r?lchristie draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 17 Feb 2016 00:22:06 +1100
changeset 331194 facd0d770d826f06ce6c8722f1a5f6783fd5a429
parent 331193 23513c10129cea3bdbc2c7b16863d3fcf21c80c1
child 514327 f8780a18d8127c79b1ac95f7f68128b0eadec5d5
push id10927
push userbmo:jyavenard@mozilla.com
push dateTue, 16 Feb 2016 13:22:28 +0000
reviewerslchristie
bugs1248570
milestone47.0a1
Bug 1248570: Allow WAV into media element. r?lchristie MozReview-Commit-ID: AKIQq9EyCC6
dom/media/DecoderTraits.cpp
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -339,24 +339,16 @@ IsWAVSupportedType(const nsACString& aTy
                    const nsAString& aCodecs = EmptyString())
 {
   return WaveDecoder::CanHandleMediaType(aType, aCodecs);
 }
 
 /* static */
 bool DecoderTraits::ShouldHandleMediaType(const char* aMIMEType)
 {
-  if (IsWaveType(nsDependentCString(aMIMEType))) {
-    // We should not return true for Wave types, since there are some
-    // Wave codecs actually in use in the wild that we don't support, and
-    // we should allow those to be handled by plugins or helper apps.
-    // Furthermore people can play Wave files on most platforms by other
-    // means.
-    return false;
-  }
   return CanHandleMediaType(aMIMEType, false, EmptyString()) != CANPLAY_NO;
 }
 
 /* static */
 CanPlayStatus
 DecoderTraits::CanHandleCodecsType(const char* aMIMEType,
                                    const nsAString& aRequestedCodecs)
 {
@@ -689,16 +681,17 @@ bool DecoderTraits::IsSupportedInVideoDo
 #ifdef MOZ_ANDROID_OMX
     (MediaDecoder::IsAndroidMediaEnabled() && IsAndroidMediaType(aType)) ||
 #endif
 #ifdef MOZ_FMP4
     IsMP4SupportedType(aType) ||
 #endif
     IsMP3SupportedType(aType) ||
     IsAACSupportedType(aType) ||
+    IsWAVSupportedType(aType) ||
 #ifdef MOZ_DIRECTSHOW
     IsDirectShowSupportedType(aType) ||
 #endif
 #ifdef NECKO_PROTOCOL_rtsp
     IsRtspSupportedType(aType) ||
 #endif
     false;
 }