Bug 1289334 - HTMLMediaElement::ResetConnectionState() should shut down the decoder. r=cpearce

MozReview-Commit-ID: 7IZ2Y4Da7xZ

--HG--
extra : rebase_source : 492b0caa52fca17d2c399c2f0e2c426c6f55872f
This commit is contained in:
JW Wang 2016-07-26 16:37:45 +08:00
Родитель a2a7e29ce7
Коммит 8e6ae76d98
3 изменённых файлов: 7 добавлений и 8 удалений

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

@ -2614,6 +2614,9 @@ HTMLMediaElement::ResetConnectionState()
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY);
ChangeDelayLoadStatus(false);
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING);
if (mDecoder) {
ShutdownDecoder();
}
}
void

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

@ -1025,14 +1025,8 @@ MediaDecoder::ResetConnectionState()
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!IsShutdown());
// Notify the media element that connection gets lost.
mOwner->ResetConnectionState();
// Since we have notified the media element the connection
// lost event, the decoder will be reloaded when user tries
// to play the Rtsp streaming next time.
Shutdown();
MOZ_ASSERT(IsShutdown());
}
void

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

@ -134,8 +134,10 @@ public:
// ImageContainer containing the video data.
virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
// Called by the media decoder object, on the main thread,
// Called by the decoder object, on the main thread,
// when the connection between Rtsp server and client gets lost.
// The decoder owner should call Shutdown() on the decoder and drop the
// reference to the decoder to prevent further calls into the decoder.
virtual void ResetConnectionState() = 0;
// Called by media decoder when the audible state changed