bug 962719 update NextFrameStatus() on finished notification r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 04 Aug 2015 17:43:46 +1200
changeset 257984 5eeaba5f8b8a6cb8c7f6e729df1fbf3b13ed7ac1
parent 257983 62d6eeb7619d17ba0ddbcf25ff57f92dd91ec36d
child 257985 82f1fab387233061a6137c7a104863faa9c294e9
push id29238
push userryanvm@gmail.com
push dateMon, 17 Aug 2015 13:06:57 +0000
treeherdermozilla-central@a6eeb28458fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs962719
milestone43.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 962719 update NextFrameStatus() on finished notification r=roc This provides HAVE_CURRENT_DATA readyState.
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2866,16 +2866,20 @@ public:
   void Forget() { mElement = nullptr; }
 
   // Main thread
   void DoNotifyFinished()
   {
     if (mElement) {
       nsRefPtr<HTMLMediaElement> deathGrip = mElement;
       mElement->PlaybackEnded();
+      // Update NextFrameStatus() to move to NEXT_FRAME_UNAVAILABLE and
+      // HAVE_CURRENT_DATA.
+      mElement = nullptr;
+      NotifyWatchers();
     }
   }
 
   MediaDecoderOwner::NextFrameStatus NextFrameStatus()
   {
     if (!mElement || !mHaveCurrentData) {
       return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
     }