Core: Fix possible video sync deadlock

This commit is contained in:
Vicki Pfau 2020-11-27 17:38:31 -08:00
parent 39324749f2
commit bb74b60cd9
1 changed files with 2 additions and 1 deletions

View File

@ -49,11 +49,11 @@ bool mCoreSyncWaitFrameStart(struct mCoreSync* sync) {
}
MutexLock(&sync->videoFrameMutex);
ConditionWake(&sync->videoFrameRequiredCond);
if (!sync->videoFrameWait && !sync->videoFramePending) {
return false;
}
if (sync->videoFrameWait) {
ConditionWake(&sync->videoFrameRequiredCond);
if (ConditionWaitTimed(&sync->videoFrameAvailableCond, &sync->videoFrameMutex, 50)) {
return false;
}
@ -67,6 +67,7 @@ void mCoreSyncWaitFrameEnd(struct mCoreSync* sync) {
return;
}
ConditionWake(&sync->videoFrameRequiredCond);
MutexUnlock(&sync->videoFrameMutex);
}