diff --git a/source/shared_lib/include/util/util.h b/source/shared_lib/include/util/util.h index 8e8714f0..1ba171b4 100644 --- a/source/shared_lib/include/util/util.h +++ b/source/shared_lib/include/util/util.h @@ -52,7 +52,7 @@ public: static uint64 getFlags() { return flags; } static void setFlag(GlobalStaticFlagTypes flag) { flags |= flag; } - static bool isFlagSet(GlobalStaticFlagTypes flag) { return (flags & (unsigned int)flag) == flag; } + static bool isFlagSet(GlobalStaticFlagTypes flag) { return (flags & (unsigned int)flag) == (unsigned int)flag; } protected: static bool isNonGraphicalMode; diff --git a/source/shared_lib/sources/graphics/video_player.cpp b/source/shared_lib/sources/graphics/video_player.cpp index 972b2012..819dc3ec 100644 --- a/source/shared_lib/sources/graphics/video_player.cpp +++ b/source/shared_lib/sources/graphics/video_player.cpp @@ -163,31 +163,35 @@ static inline void loadTexture(class ctx *ctx) { glTexImage2D(GL_TEXTURE_2D, 0, 4, ctx->width, ctx->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (Uint8 *) rawData); } -//static void *lock(void *data, void **p_pixels) { -// class ctx *ctx = (class ctx *)data; -// if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__); -// -// SDL_LockMutex(ctx->mutex); -// SDL_LockSurface(ctx->surf); -// *p_pixels = ctx->surf->pixels; -// -// return NULL; /* picture identifier, not needed here */ -//} -// -//static void unlock(void *data, void *id, void *const *p_pixels) { -// class ctx *ctx = (class ctx *)data; -// if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__); -// -// /* VLC just rendered the video, but we can also render stuff */ -// SDL_UnlockSurface(ctx->surf); -// SDL_UnlockMutex(ctx->mutex); -//} -// -//static void display(void *data, void *id) { -// // VLC wants to display the video -// class ctx *ctx = (class ctx *)data; -// if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__); -//} +#ifdef HAS_LIBVLC +#if !defined(LIBVLC_VERSION_PRE_2) && !defined(LIBVLC_VERSION_PRE_1_1_0) +static void *lock(void *data, void **p_pixels) { + class ctx *ctx = (class ctx *)data; + if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__); + + SDL_LockMutex(ctx->mutex); + SDL_LockSurface(ctx->surf); + *p_pixels = ctx->surf->pixels; + + return NULL; /* picture identifier, not needed here */ +} + +static void unlock(void *data, void *id, void *const *p_pixels) { + class ctx *ctx = (class ctx *)data; + if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__); + + /* VLC just rendered the video, but we can also render stuff */ + SDL_UnlockSurface(ctx->surf); + SDL_UnlockMutex(ctx->mutex); +} + +static void display(void *data, void *id) { + // VLC wants to display the video + class ctx *ctx = (class ctx *)data; + if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__); +} +#endif +#endif #if defined(HAS_LIBVLC) && defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0) static void catchError(libvlc_exception_t *ex) {