Bug 1367983 - correct comment.
We still need to keep the resource on Android, otherwise the frame we render would be wrong.
MozReview-Commit-ID: 2d6sfIuhfWY
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1951,18 +1951,18 @@ private:
class MediaDecoderStateMachine::CompletedState
: public MediaDecoderStateMachine::StateObject
{
public:
explicit CompletedState(Master* aPtr) : StateObject(aPtr) { }
void Enter()
{
- // TODO : use more approriate way to decide whether need to release
- // resource in bug1367983.
+ // On Android, the life cycle of graphic buffer is equal to Android's codec,
+ // we couldn't release it if we still need to render the frame.
#ifndef MOZ_WIDGET_ANDROID
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)