]> git.sesse.net Git - vlc/commitdiff
prepare video outputs for display size not equal to encoded size
authorMarian Durkovic <md@videolan.org>
Tue, 18 Oct 2005 07:12:27 +0000 (07:12 +0000)
committerMarian Durkovic <md@videolan.org>
Tue, 18 Oct 2005 07:12:27 +0000 (07:12 +0000)
modules/video_output/sdl.c
modules/video_output/x11/xcommon.c

index fa4fa29adb09b60e30235bb4d23084ffaabb317e..55f067538c593f387b3a2de5aa410d562dbfc0c3 100644 (file)
@@ -42,7 +42,8 @@
 
 #include SDL_INCLUDE_FILE
 
-#define SDL_MAX_DIRECTBUFFERS 10
+/* SDL is not able to crop overlays - so use only 1 direct buffer */
+#define SDL_MAX_DIRECTBUFFERS 1
 #define SDL_DEFAULT_BPP 16
 
 /*****************************************************************************
index b6592477a27ee074e6019d17d0272d2d2b681643..096f138a550ad4191e8de74e945dd34464463ee5 100644 (file)
@@ -2030,6 +2030,11 @@ static IMAGE_TYPE * CreateShmImage( vout_thread_t *p_vout,
 
     /* Create XImage / XvImage */
 #ifdef MODULE_NAME_IS_xvideo
+
+    /* Make sure the buffer is aligned to multiple of 16 */
+    i_height = ( i_height + 15 ) >> 4 << 4;
+    i_width = ( i_width + 15 ) >> 4 << 4;
+
     p_image = XvShmCreateImage( p_display, i_xvport, i_chroma, 0,
                                 i_width, i_height, p_shm );
 #else
@@ -2114,6 +2119,11 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
 
     /* Allocate memory for image */
 #ifdef MODULE_NAME_IS_xvideo
+
+    /* Make sure the buffer is aligned to multiple of 16 */
+    i_height = ( i_height + 15 ) >> 4 << 4;
+    i_width = ( i_width + 15 ) >> 4 << 4;
+
     p_data = (byte_t *) malloc( i_width * i_height * i_bits_per_pixel / 8 );
 #elif defined(MODULE_NAME_IS_x11)
     i_bytes_per_line = i_width * i_bytes_per_pixel;