[vlc-devel] commit: Mimic X11 plugin picture allocation ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Apr 16 20:00:54 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 16 21:00:22 2009 +0300| [38c3b44d255c1e1fd974e290fdad36f711dc0087] | committer: Rémi Denis-Courmont 

Mimic X11 plugin picture allocation

(It still crashes on resize nevertheless)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38c3b44d255c1e1fd974e290fdad36f711dc0087
---

 modules/video_output/xcb/xcb.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/xcb/xcb.c b/modules/video_output/xcb/xcb.c
index 99520d9..b4d9a0f 100644
--- a/modules/video_output/xcb/xcb.c
+++ b/modules/video_output/xcb/xcb.c
@@ -484,15 +484,19 @@ static int Init (vout_thread_t *vout)
     xcb_flush (p_sys->conn);
 
     /* Allocate picture buffers */
-    do
+    I_OUTPUTPICTURES = 0;
+    for (size_t index = 0; I_OUTPUTPICTURES < 2; index++)
     {
-        picture_t *pic = vout->p_picture + I_OUTPUTPICTURES;
+        picture_t *pic = vout->p_picture + index;
 
+        if (index > sizeof (vout->p_picture) / sizeof (pic))
+            break;
+        if (pic->i_status != FREE_PICTURE)
+            continue;
         if (PictureInit (vout, pic))
             break;
         PP_OUTPUTPICTURE[I_OUTPUTPICTURES++] = pic;
     }
-    while (I_OUTPUTPICTURES < 2);
 
     return VLC_SUCCESS;
 




More information about the vlc-devel mailing list