Bug 1065855 - Check for waiting media resources before calling ReadMetadata - r=cpearce

--HG--
extra : rebase_source : 45022c3d553e82e098908af7682cf241593b57f9
This commit is contained in:
Chris Double 2014-09-16 15:15:58 +12:00
parent 8b7ea8cf50
commit ff897a2a2b
2 changed files with 8 additions and 7 deletions

View File

@ -1911,6 +1911,11 @@ nsresult MediaDecoderStateMachine::DecodeMetadata()
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
DECODER_LOG("Decoding Media Headers");
if (mReader->IsWaitingMediaResources()) {
StartWaitForResources();
return NS_OK;
}
nsresult res;
MediaInfo info;
{

View File

@ -470,14 +470,10 @@ MediaSourceReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
nsresult
MediaSourceReader::ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags)
{
bool waiting = IsWaitingMediaResources();
MSE_DEBUG("MediaSourceReader(%p)::ReadMetadata waiting=%d tracks=%u/%u audio=%p video=%p",
this, waiting, mEssentialTrackBuffers.Length(), mTrackBuffers.Length(),
MSE_DEBUG("MediaSourceReader(%p)::ReadMetadata tracks=%u/%u audio=%p video=%p",
this, mEssentialTrackBuffers.Length(), mTrackBuffers.Length(),
mAudioTrack.get(), mVideoTrack.get());
// ReadMetadata is called *before* checking IsWaitingMediaResources.
if (waiting) {
return NS_OK;
}
mEssentialTrackBuffers.Clear();
if (!mAudioTrack && !mVideoTrack) {
MSE_DEBUG("MediaSourceReader(%p)::ReadMetadata missing track: mAudioTrack=%p mVideoTrack=%p",