Bug 1221881 - HTMLMediaElement::NetworkError() should clear mDecoder. See bug 1221881 comment 2 for the root cause. r=cpearce. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 11 Nov 2015 15:18:11 +0800
changeset 308394 af37976cd44bcd8093da56fe25253aa5ed9d09f1
parent 308393 5da31d324ebf3ec4701a15a66e06855146bfa642
child 308395 3704f994f70e1dcc55f8845c781732721d570e12
push id7466
push userjwwang@mozilla.com
push dateThu, 12 Nov 2015 10:08:41 +0000
reviewerscpearce
bugs1221881
milestone45.0a1
Bug 1221881 - HTMLMediaElement::NetworkError() should clear mDecoder. See bug 1221881 comment 2 for the root cause. r=cpearce.
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3455,16 +3455,19 @@ void HTMLMediaElement::FirstFrameLoaded(
       mPreloadAction == HTMLMediaElement::PRELOAD_METADATA) {
     mSuspendedAfterFirstFrame = true;
     mDecoder->Suspend();
   }
 }
 
 void HTMLMediaElement::NetworkError()
 {
+  if (mDecoder) {
+    ShutdownDecoder();
+  }
   Error(nsIDOMMediaError::MEDIA_ERR_NETWORK);
 }
 
 void HTMLMediaElement::DecodeError()
 {
   nsAutoString src;
   GetCurrentSrc(src);
   const char16_t* params[] = { src.get() };