Bug 1371202. P2 - don't release decoders if we are looping since we will need them soon.
MozReview-Commit-ID: L1hOBytfENK
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1905,18 +1905,21 @@ class MediaDecoderStateMachine::Complete
public:
explicit CompletedState(Master* aPtr) : StateObject(aPtr) { }
void Enter()
{
// TODO : use more approriate way to decide whether need to release
// resource in bug1367983.
#ifndef MOZ_WIDGET_ANDROID
- // We've decoded all samples. We don't need decoders anymore.
- Reader()->ReleaseResources();
+ if (!mMaster->mLooping) {
+ // We've decoded all samples.
+ // We don't need decoders anymore if not looping.
+ Reader()->ReleaseResources();
+ }
#endif
bool hasNextFrame = (!mMaster->HasAudio() || !mMaster->mAudioCompleted)
&& (!mMaster->HasVideo() || !mMaster->mVideoCompleted);
mMaster->UpdateNextFrameStatus(
hasNextFrame ? MediaDecoderOwner::NEXT_FRAME_AVAILABLE
: MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE);