зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1508484 - close audio queue if we already got the last audio frame when leaving 'loopingDecoding' state r=jya
When we're going to leave looping state and have got EOS before, we should mark audio queue as ended because we have got all data we need. Differential Revision: https://phabricator.services.mozilla.com/D12373 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
8a7fef1076
Коммит
ce1f4614d0
|
@ -762,8 +762,12 @@ class MediaDecoderStateMachine::LoopingDecodingState
|
||||||
if (ShouldDiscardLoopedAudioData()) {
|
if (ShouldDiscardLoopedAudioData()) {
|
||||||
mMaster->mAudioDataRequest.DisconnectIfExists();
|
mMaster->mAudioDataRequest.DisconnectIfExists();
|
||||||
DiscardLoopedAudioData();
|
DiscardLoopedAudioData();
|
||||||
|
}
|
||||||
|
if (HasDecodedLastAudioFrame()) {
|
||||||
AudioQueue().Finish();
|
AudioQueue().Finish();
|
||||||
}
|
}
|
||||||
|
mAudioDataRequest.DisconnectIfExists();
|
||||||
|
mAudioSeekRequest.DisconnectIfExists();
|
||||||
DecodingState::Exit();
|
DecodingState::Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -890,6 +894,14 @@ class MediaDecoderStateMachine::LoopingDecodingState
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasDecodedLastAudioFrame() const {
|
||||||
|
// when we're going to leave looping state and have got EOS before, we should
|
||||||
|
// mark audio queue as ended because we have got all data we need.
|
||||||
|
return mAudioDataRequest.Exists() ||
|
||||||
|
mAudioSeekRequest.Exists() ||
|
||||||
|
ShouldDiscardLoopedAudioData();
|
||||||
|
}
|
||||||
|
|
||||||
media::TimeUnit mAudioLoopingOffset = media::TimeUnit::Zero();
|
media::TimeUnit mAudioLoopingOffset = media::TimeUnit::Zero();
|
||||||
MozPromiseRequestHolder<MediaFormatReader::SeekPromise> mAudioSeekRequest;
|
MozPromiseRequestHolder<MediaFormatReader::SeekPromise> mAudioSeekRequest;
|
||||||
MozPromiseRequestHolder<AudioDataPromise> mAudioDataRequest;
|
MozPromiseRequestHolder<AudioDataPromise> mAudioDataRequest;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче