mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1090991 - Introduce a new NotDecodedReason WAITING_FOR_DATA and use it for MSE. r=cpearce,r=cajbir
This commit is contained in:
parent
4482a8ac0f
commit
56a6b50f23
@ -257,7 +257,8 @@ public:
|
||||
|
||||
enum NotDecodedReason {
|
||||
END_OF_STREAM,
|
||||
DECODE_ERROR
|
||||
DECODE_ERROR,
|
||||
WAITING_FOR_DATA
|
||||
};
|
||||
|
||||
// Receives the result of a RequestAudioData() call.
|
||||
|
@ -818,6 +818,12 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
|
||||
return;
|
||||
}
|
||||
|
||||
// If the decoder is waiting for data, there's nothing more to do after
|
||||
// clearing the pending request.
|
||||
if (aReason == RequestSampleCallback::WAITING_FOR_DATA) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This is an EOS. Finish off the queue, and then handle things based on our
|
||||
// state.
|
||||
MOZ_ASSERT(aReason == RequestSampleCallback::END_OF_STREAM);
|
||||
|
@ -167,7 +167,7 @@ MediaSourceReader::OnNotDecoded(MediaData::Type aType, RequestSampleCallback::No
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aReason == RequestSampleCallback::END_OF_STREAM);
|
||||
// See if we can find a different reader that can pick up where we left off.
|
||||
if (aType == MediaData::AUDIO_DATA && SwitchAudioReader(mLastAudioTime)) {
|
||||
RequestAudioData();
|
||||
return;
|
||||
@ -177,11 +177,15 @@ MediaSourceReader::OnNotDecoded(MediaData::Type aType, RequestSampleCallback::No
|
||||
return;
|
||||
}
|
||||
|
||||
// If the entire MediaSource is done, generate an EndOfStream.
|
||||
if (IsEnded()) {
|
||||
GetCallback()->OnNotDecoded(aType, aReason);
|
||||
GetCallback()->OnNotDecoded(aType, RequestSampleCallback::END_OF_STREAM);
|
||||
return;
|
||||
}
|
||||
|
||||
// Drop anything else on the floor. This gets fixed in the next patch.
|
||||
// We don't have the data the caller wants. Tell that we're waiting for JS to
|
||||
// give us more data.
|
||||
GetCallback()->OnNotDecoded(aType, RequestSampleCallback::WAITING_FOR_DATA);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user