Bug 1115505 - keep decoding to ensure the stream is initialized in the decode-to-stream case. r=roc

This commit is contained in:
JW Wang 2014-12-25 01:26:00 +01:00
parent 05404cf3f4
commit 1bb19d6931

View File

@ -531,6 +531,13 @@ bool MediaDecoderStateMachine::HaveEnoughDecodedAudio(int64_t aAmpleAudioUSecs)
}
DecodedStreamData* stream = mDecoder->GetDecodedStream();
// Since stream is initialized in SendStreamData() which is called when
// audio/video samples are received, we need to keep decoding to ensure
// the stream is initialized.
if (stream && !stream->mStreamInitialized) {
return false;
}
if (stream && stream->mStreamInitialized && !stream->mHaveSentFinishAudio) {
if (!stream->mStream->HaveEnoughBuffered(kAudioTrack)) {
return false;
@ -551,6 +558,11 @@ bool MediaDecoderStateMachine::HaveEnoughDecodedVideo()
}
DecodedStreamData* stream = mDecoder->GetDecodedStream();
if (stream && !stream->mStreamInitialized) {
return false;
}
if (stream && stream->mStreamInitialized && !stream->mHaveSentFinishVideo) {
if (!stream->mStream->HaveEnoughBuffered(kVideoTrack)) {
return false;