diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-16 15:35:44 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-16 15:35:44 +0200 |
commit | 2d6ab4c707f6a6cc4360260d9a9a93b0c9ba4b10 (patch) | |
tree | 25ac3f46624dd0bdc4ce0029612024f85505fe5e | |
parent | e4791c8a423dd7f981bd81775e8740a1da0f26fb (diff) | |
download | osc-graphics-2d6ab4c707f6a6cc4360260d9a9a93b0c9ba4b10.tar.gz |
video layers: lock when accessing surface
-rw-r--r-- | main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 |