Bug 931453 - Ensure TextTrack's media element reference is not null. r=khuey

This commit is contained in:
Andrew Quartey 2013-10-28 12:32:51 -04:00
Родитель afb59eda40
Коммит 6070d164e6
2 изменённых файлов: 4 добавлений и 3 удалений

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

@ -182,8 +182,8 @@ void
TextTrack::SetReadyState(uint16_t aState) TextTrack::SetReadyState(uint16_t aState)
{ {
mReadyState = aState; mReadyState = aState;
if (mReadyState == HTMLTrackElement::LOADED || if (mMediaElement && (mReadyState == HTMLTrackElement::LOADED ||
mReadyState == HTMLTrackElement::ERROR) { mReadyState == HTMLTrackElement::ERROR)) {
mMediaElement->RemoveTextTrack(this, true); mMediaElement->RemoveTextTrack(this, true);
} }
} }

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

@ -107,7 +107,8 @@ WebVTTListener::OnStopRequest(nsIRequest* aRequest,
nsresult aStatus) nsresult aStatus)
{ {
if (mElement->ReadyState() != HTMLTrackElement::ERROR) { if (mElement->ReadyState() != HTMLTrackElement::ERROR) {
mElement->mTrack->SetReadyState(HTMLTrackElement::LOADED); TextTrack* track = mElement->Track();
track->SetReadyState(HTMLTrackElement::LOADED);
} }
// Attempt to parse any final data the parser might still have. // Attempt to parse any final data the parser might still have.
mParserWrapper->Flush(); mParserWrapper->Flush();