Bug 882677 - Part 3: Set Track::ReadyState after flushing the parser. r=cpearce
authorRick Eyre <rick.eyre@hotmail.com>
Mon, 17 Mar 2014 16:52:11 -0400
changeset 195207 f7070512d32e1585b847d156e61dd195e7828cc5
parent 195206 f7d0a826175b5506fa05689c92112cf2586d5407
child 195208 de26080d3130cee4911c13f270dad8e79f7dcc3a
push idunknown
push userunknown
push dateunknown
reviewerscpearce
bugs882677
milestone31.0a1
Bug 882677 - Part 3: Set Track::ReadyState after flushing the parser. r=cpearce The parser might report errors during the flush call so we can't check and set the ReadyState of the track yet.
content/media/WebVTTListener.cpp
--- a/content/media/WebVTTListener.cpp
+++ b/content/media/WebVTTListener.cpp
@@ -101,21 +101,21 @@ WebVTTListener::OnStartRequest(nsIReques
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WebVTTListener::OnStopRequest(nsIRequest* aRequest,
                               nsISupports* aContext,
                               nsresult aStatus)
 {
+  // Attempt to parse any final data the parser might still have.
+  mParserWrapper->Flush();
   if (mElement->ReadyState() != TextTrackReadyState::FailedToLoad) {
     mElement->SetReadyState(TextTrackReadyState::Loaded);
   }
-  // Attempt to parse any final data the parser might still have.
-  mParserWrapper->Flush();
   return NS_OK;
 }
 
 NS_METHOD
 WebVTTListener::ParseChunk(nsIInputStream* aInStream, void* aClosure,
                            const char* aFromSegment, uint32_t aToOffset,
                            uint32_t aCount, uint32_t* aWriteCount)
 {