Handle condition variable failure

Add condition variables function wrappers to handle unexpected failure.
This commit is contained in:
Romain Vimont
2017-12-15 16:38:14 +01:00
parent c4266e487b
commit b9c9466d65
3 changed files with 16 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ static void push_frame(struct decoder *decoder) {
mutex_lock(frames->mutex);
if (!decoder->skip_frames) {
while (!frames->rendering_frame_consumed) {
SDL_CondWait(frames->rendering_frame_consumed_cond, frames->mutex);
cond_wait(frames->rendering_frame_consumed_cond, frames->mutex);
}
} else if (!frames->rendering_frame_consumed) {
SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "Skip frame");