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.
This commit is contained in:
Rick Eyre 2014-03-17 16:52:11 -04:00
Родитель b1d42e4cd4
Коммит 0837ecc090
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -106,11 +106,11 @@ WebVTTListener::OnStopRequest(nsIRequest* aRequest,
nsISupports* aContext, nsISupports* aContext,
nsresult aStatus) nsresult aStatus)
{ {
// Attempt to parse any final data the parser might still have.
mParserWrapper->Flush();
if (mElement->ReadyState() != TextTrackReadyState::FailedToLoad) { if (mElement->ReadyState() != TextTrackReadyState::FailedToLoad) {
mElement->SetReadyState(TextTrackReadyState::Loaded); mElement->SetReadyState(TextTrackReadyState::Loaded);
} }
// Attempt to parse any final data the parser might still have.
mParserWrapper->Flush();
return NS_OK; return NS_OK;
} }