Bug 1367980 - don't release decoder in complete state on Fennec. r=jwwang

On Android, the life cycle of graphic buffer is equal to Android's codec, and
it would be released immediately if we shutdown the decoder.

Since the buffer has been release, the memory we access is totally meaningless.
The result is we would render the black image on the screen.

In addition, I suspect this issue might be one of the root cause which results
in lots of timeout for media mochitest, so I would like to land this patch first,
and then do the follow-up in bug1367983.

MozReview-Commit-ID: 5eZph6MItZs

--HG--
extra : rebase_source : 99036cd087bf758c8a70be686c40fa2d84d7f6c1
This commit is contained in:
Alastor Wu 2017-05-26 15:42:20 +08:00
Родитель 8729c34142
Коммит 5db65a6f2c
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -1906,9 +1906,12 @@ public:
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();
#endif
bool hasNextFrame = (!mMaster->HasAudio() || !mMaster->mAudioCompleted)
&& (!mMaster->HasVideo() || !mMaster->mVideoCompleted);