зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1120247 - 1 MediaCodecReader::ResetDecode() needs to reject(cancel) any pending promises. 2. fix regression caused by bug 1114910. r=cpearce
This commit is contained in:
Родитель
3584ed3e5f
Коммит
8e5e324b89
|
@ -758,12 +758,20 @@ nsresult
|
||||||
MediaCodecReader::ResetDecode()
|
MediaCodecReader::ResetDecode()
|
||||||
{
|
{
|
||||||
if (CheckAudioResources()) {
|
if (CheckAudioResources()) {
|
||||||
mAudioTrack.mTaskQueue->AwaitIdle();
|
mAudioTrack.mTaskQueue->Flush();
|
||||||
|
MonitorAutoLock al(mAudioTrack.mTrackMonitor);
|
||||||
|
if (!mAudioTrack.mAudioPromise.IsEmpty()) {
|
||||||
|
mAudioTrack.mAudioPromise.Reject(CANCELED, __func__);
|
||||||
|
}
|
||||||
FlushCodecData(mAudioTrack);
|
FlushCodecData(mAudioTrack);
|
||||||
mAudioTrack.mDiscontinuity = true;
|
mAudioTrack.mDiscontinuity = true;
|
||||||
}
|
}
|
||||||
if (CheckVideoResources()) {
|
if (CheckVideoResources()) {
|
||||||
mVideoTrack.mTaskQueue->AwaitIdle();
|
mVideoTrack.mTaskQueue->Flush();
|
||||||
|
MonitorAutoLock al(mVideoTrack.mTrackMonitor);
|
||||||
|
if (!mVideoTrack.mVideoPromise.IsEmpty()) {
|
||||||
|
mVideoTrack.mVideoPromise.Reject(CANCELED, __func__);
|
||||||
|
}
|
||||||
FlushCodecData(mVideoTrack);
|
FlushCodecData(mVideoTrack);
|
||||||
mVideoTrack.mDiscontinuity = true;
|
mVideoTrack.mDiscontinuity = true;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче