aboutsummaryrefslogtreecommitdiff
path: root/layer_video.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-27 06:36:48 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-27 06:36:48 +0200
commitbca2e1e95a2f85957d3702fd91fbfe513405dcb8 (patch)
tree60b5a5880f8da128dc35abbfd28ac3eda8c10f47 /layer_video.cpp
parent9a4b4fc2e36e6788191f28888098f0b8264706f2 (diff)
downloadosc-graphics-bca2e1e95a2f85957d3702fd91fbfe513405dcb8.tar.gz
fixed alpha blitting when video buffer size is not display size; don't use video URLs on windows
Diffstat (limited to 'layer_video.cpp')
-rw-r--r--layer_video.cpp10
1 files changed, 9 insertions, 1 deletions
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 <SDL.h>
#include <SDL_thread.h>
#include <SDL_rotozoom.h>
+#include <SDL_gfxBlitFunc.h>
#include <vlc/vlc.h>
#include <vlc/libvlc_version.h>
@@ -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);