aboutsummaryrefslogtreecommitdiff
path: root/src/layer_video.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-10-03 16:26:24 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-10-03 16:26:24 +0200
commitbb65f0fc2176b2ebf0f1be682008609e8bd2cb0a (patch)
treed0070ad2ef70b1a7c2ed77cec098d03402d0871f /src/layer_video.h
parent920067622e7ba72dd6947eb8e7875719315872b9 (diff)
downloadosc-graphics-bb65f0fc2176b2ebf0f1be682008609e8bd2cb0a.tar.gz
simplified mutex locking idiom by introducing Mutex class (wrapper around SDL_mutex)
* can be instantiated * can derive from class Mutex to inherit the lock()/unlock() methods also fixed LayerList destructor
Diffstat (limited to 'src/layer_video.h')
-rw-r--r--src/layer_video.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/layer_video.h b/src/layer_video.h
index c3a4806..1ae3e18 100644
--- a/src/layer_video.h
+++ b/src/layer_video.h
@@ -2,7 +2,6 @@
#define __LAYER_VIDEO_H
#include <SDL.h>
-#include <SDL_thread.h>
#include <lo/lo.h>
@@ -16,7 +15,7 @@ class LayerVideo : public Layer {
libvlc_media_player_t *mp;
SDL_Surface *surf;
- SDL_mutex *mutex;
+ Mutex mutex;
SDL_Rect geov;
float alphav;
@@ -42,7 +41,7 @@ public:
inline void *
lock_surf()
{
- SDL_LockMutex(mutex);
+ mutex.lock();
SDL_MAYBE_LOCK(surf);
return surf->pixels;
}
@@ -50,7 +49,7 @@ public:
unlock_surf()
{
SDL_MAYBE_UNLOCK(surf);
- SDL_UnlockMutex(mutex);
+ mutex.unlock();
}
void frame(SDL_Surface *target);