Bug 1064118 - Drop MediaSourceReader sub-reader refs in a safer order. r=cajbir

This commit is contained in:
Matthew Gregan 2014-09-08 12:59:36 +12:00
parent 424406e1b8
commit 5c88bf3ea3

View File

@ -209,28 +209,28 @@ void
MediaSourceReader::Shutdown() MediaSourceReader::Shutdown()
{ {
MediaDecoderReader::Shutdown(); MediaDecoderReader::Shutdown();
for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) {
mTrackBuffers[i]->Shutdown();
}
mTrackBuffers.Clear();
mAudioTrack = nullptr; mAudioTrack = nullptr;
mAudioReader = nullptr; mAudioReader = nullptr;
mVideoTrack = nullptr; mVideoTrack = nullptr;
mVideoReader = nullptr; mVideoReader = nullptr;
for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) {
mTrackBuffers[i]->Shutdown();
}
mTrackBuffers.Clear();
} }
void void
MediaSourceReader::BreakCycles() MediaSourceReader::BreakCycles()
{ {
MediaDecoderReader::BreakCycles(); MediaDecoderReader::BreakCycles();
for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) {
mTrackBuffers[i]->BreakCycles();
}
mTrackBuffers.Clear();
mAudioTrack = nullptr; mAudioTrack = nullptr;
mAudioReader = nullptr; mAudioReader = nullptr;
mVideoTrack = nullptr; mVideoTrack = nullptr;
mVideoReader = nullptr; mVideoReader = nullptr;
for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) {
mTrackBuffers[i]->BreakCycles();
}
mTrackBuffers.Clear();
} }
bool bool