Bug 1160441 - Change exception code when MediaSource.addSourceBuffer() fails due to user disabling MP4. r=edwin
authorChris Pearce <cpearce@mozilla.com>
Tue, 30 Jun 2015 13:50:50 +1200
changeset 250660 2e2c01585a9865e3569ae911a156ff643d6f1e18
parent 250659 67d1702bfb1f475f414d99ffc4f1cc963e030332
child 250661 c3eb721ea1e76d64a3f3d270637a195d28fdf9f2
push id28966
push usercbook@mozilla.com
push dateTue, 30 Jun 2015 11:23:37 +0000
treeherdermozilla-central@291614a686f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1160441
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1160441 - Change exception code when MediaSource.addSourceBuffer() fails due to user disabling MP4. r=edwin
dom/media/mediasource/MediaSource.cpp
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -95,22 +95,22 @@ IsTypeSupported(const nsAString& aType)
       if ((mimeType.EqualsASCII("video/mp4") ||
            mimeType.EqualsASCII("audio/mp4")) &&
           (!Preferences::GetBool("media.mediasource.mp4.enabled", false)
 #ifdef MOZ_WIDGET_ANDROID
           // MP4 won't work unless we have JellyBean+
           || AndroidBridge::Bridge()->GetAPIVersion() < 16
 #endif
           )) {
-        break;
+        return NS_ERROR_DOM_INVALID_STATE_ERR;
       }
       if ((mimeType.EqualsASCII("video/webm") ||
            mimeType.EqualsASCII("audio/webm")) &&
           !Preferences::GetBool("media.mediasource.webm.enabled", false)) {
-        break;
+        return NS_ERROR_DOM_INVALID_STATE_ERR;
       }
       found = true;
       break;
     }
   }
   if (!found) {
     return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
   }