Bug 1105913 - [b2g] video can't playback after waking up from the dormant state, part 2 : revert changeset. r=roc.

This commit is contained in:
Alastor Wu 2014-12-23 15:03:15 +08:00
Родитель 35e5ba65a8
Коммит b357dcd13a
1 изменённых файлов: 9 добавлений и 13 удалений

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

@ -295,19 +295,17 @@ void MediaDecoder::DestroyDecodedStream()
// be careful not to send any messages after the Destroy().
if (os.mStream->IsDestroyed()) {
// Probably the DOM MediaStream was GCed. Clean up.
if (os.mPort) {
os.mPort->Destroy();
}
MOZ_ASSERT(os.mPort, "Double-delete of the ports!");
os.mPort->Destroy();
mOutputStreams.RemoveElementAt(i);
continue;
}
os.mStream->ChangeExplicitBlockerCount(1);
// Explicitly remove all existing ports. This is not strictly necessary but it's
// good form.
if (os.mPort) {
os.mPort->Destroy();
os.mPort = nullptr;
}
MOZ_ASSERT(os.mPort, "Double-delete of the ports!");
os.mPort->Destroy();
os.mPort = nullptr;
}
mDecodedStream = nullptr;
@ -856,9 +854,8 @@ void MediaDecoder::PlaybackEnded()
OutputStreamData& os = mOutputStreams[i];
if (os.mStream->IsDestroyed()) {
// Probably the DOM MediaStream was GCed. Clean up.
if (os.mPort) {
os.mPort->Destroy();
}
MOZ_ASSERT(os.mPort, "Double-delete of the ports!");
os.mPort->Destroy();
mOutputStreams.RemoveElementAt(i);
continue;
}
@ -866,9 +863,8 @@ void MediaDecoder::PlaybackEnded()
// Shouldn't really be needed since mDecodedStream should already have
// finished, but doesn't hurt.
os.mStream->Finish();
if (os.mPort) {
os.mPort->Destroy();
}
MOZ_ASSERT(os.mPort, "Double-delete of the ports!");
os.mPort->Destroy();
// Not really needed but it keeps the invariant that a stream not
// connected to mDecodedStream is explicity blocked.
os.mStream->ChangeExplicitBlockerCount(1);