From bca2e1e95a2f85957d3702fd91fbfe513405dcb8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 27 Sep 2012 06:36:48 +0200 Subject: fixed alpha blitting when video buffer size is not display size; don't use video URLs on windows --- layer_video.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/layer_video.cpp b/layer_video.cpp index eafe67a..192bb73 100644 --- a/layer_video.cpp +++ b/layer_video.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -154,7 +155,12 @@ LayerVideo::url(const char *url) if (!url || !*url) return; +#ifdef __WIN32__ + /* URL handling somehow broken under Windows */ + m = libvlc_media_new_path(vlcinst, url); +#else m = libvlc_media_new_location(vlcinst, url); +#endif mp = libvlc_media_player_new_from_media(m); media_get_video_size(m, width, height); libvlc_media_release(m); @@ -235,7 +241,9 @@ LayerVideo::frame(SDL_Surface *target) SMOOTHING_ON); SDL_UnlockMutex(mutex); - if (alpha < SDL_ALPHA_OPAQUE) + if (surf_scaled->format->Amask) + SDL_gfxMultiplyAlpha(surf_scaled, alpha); + else if (alpha < SDL_ALPHA_OPAQUE) SDL_SetAlpha(surf_scaled, SDL_SRCALPHA | SDL_RLEACCEL, alpha); SDL_BlitSurface(surf_scaled, NULL, target, &geov); -- cgit v1.2.3