From 2d6ab4c707f6a6cc4360260d9a9a93b0c9ba4b10 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 16 Sep 2012 15:35:44 +0200 Subject: video layers: lock when accessing surface --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 9d245f5..e841299 100644 --- a/main.c +++ b/main.c @@ -527,10 +527,12 @@ layer_video_alpha(struct layer_video *ctx, float opacity) { Uint8 alpha = (Uint8)ceilf(opacity*SDL_ALPHA_OPAQUE); + SDL_LockMutex(ctx->mutex); if (alpha == SDL_ALPHA_OPAQUE) SDL_SetAlpha(ctx->surf, 0, 0); else SDL_SetAlpha(ctx->surf, SDL_SRCALPHA | SDL_RLEACCEL, alpha); + SDL_UnlockMutex(ctx->mutex); } static void -- cgit v1.2.3