Bug 1160441 - Change exception code when MediaSource.addSourceBuffer() fails due to user disabling MP4. r=edwin,a=ritu
authorChris Pearce <cpearce@mozilla.com>
Tue, 30 Jun 2015 13:50:50 +1200
changeset 275245 8c6508de1b3a08307d4bca7eecefad309ed4d897
parent 275244 b1b9503edc7c5f3b8e5d9723f94e0d9426b84a5e
child 275246 895816df56b0d9c62ca960e03786b32fcb0adaa7
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, ritu
bugs1160441
milestone40.0
Bug 1160441 - Change exception code when MediaSource.addSourceBuffer() fails due to user disabling MP4. r=edwin,a=ritu
dom/media/mediasource/MediaSource.cpp
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -88,22 +88,22 @@ IsTypeSupported(const nsAString& aType)
     return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
   }
   bool found = false;
   for (uint32_t i = 0; gMediaSourceTypes[i]; ++i) {
     if (mimeType.EqualsASCII(gMediaSourceTypes[i])) {
       if ((mimeType.EqualsASCII("video/mp4") ||
            mimeType.EqualsASCII("audio/mp4")) &&
           !Preferences::GetBool("media.mediasource.mp4.enabled", false)) {
-        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;
   }