Bug 1337265: Properly reset state when shutting down decoder. r?jwwang draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 07 Feb 2017 17:06:17 +0100
changeset 480639 8cdc552e321a845596486de378b372ea3ff653d2
parent 480638 dd0be3835d1dd55063d2025adfe5dbde86c0cdd4
child 480640 a655fc536caedd4815f58531d47b0d152e2b1b44
push id44612
push userbmo:jyavenard@mozilla.com
push dateWed, 08 Feb 2017 19:03:27 +0000
reviewersjwwang
bugs1337265
milestone54.0a1
Bug 1337265: Properly reset state when shutting down decoder. r?jwwang MozReview-Commit-ID: IJ6lu2WHl2A
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -211,16 +211,17 @@ public:
     }
     if (data.mShutdownRequest.Exists()) {
       // A shutdown is already in progress due to a prior initialization error,
       // return the existing promise.
       data.mShutdownRequest.Disconnect();
       RefPtr<ShutdownPromise> p = data.mShutdownPromise.forget();
       return p;
     }
+    data.mStage = Stage::None;
     RefPtr<MediaDataDecoder> decoder = data.mDecoder.forget();
     return decoder->Shutdown();
   }
 
 private:
   class Wrapper;
 
   enum class Stage : int8_t