[MPlayer-cvslog] CVS: main/libvo vo_dfbmga.c,1.25,1.26

Ville Syrjälä CVS syncmail at mplayerhq.hu
Mon Mar 7 23:45:49 CET 2005


CVS change done by Ville Syrjälä CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv6464

Modified Files:
	vo_dfbmga.c 
Log Message:
Clean up properly if preinit() fails.

Index: vo_dfbmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dfbmga.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- vo_dfbmga.c	17 Feb 2005 00:05:23 -0000	1.25
+++ vo_dfbmga.c	7 Mar 2005 22:45:47 -0000	1.26
@@ -224,6 +224,8 @@
      return DFENUM_OK;
 }
 
+static void uninit( void );
+
 static uint32_t
 preinit( const char *arg )
 {
@@ -425,11 +427,13 @@
           if (l.res != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get primary layer - %s\n",
                        DirectFBErrorString( l.res ) );
+               uninit();
                return -1;
           }
           if ((res = primary->SetCooperativeLevel( primary, DLSCL_EXCLUSIVE )) != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to primary layer - %s\n",
                        DirectFBErrorString( res ) );
+               uninit();
                return -1;
           }
           use_input = 1;
@@ -451,11 +455,13 @@
           if (l.res != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR, "Can't get BES layer - %s\n",
                        DirectFBErrorString( l.res ) );
+               uninit();
                return -1;
           }
           if ((res = bes->SetCooperativeLevel( bes, DLSCL_EXCLUSIVE )) != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to BES - %s\n",
                        DirectFBErrorString( res ) );
+               uninit();
                return -1;
           }
           dlc.flags = DLCONF_PIXELFORMAT;
@@ -481,11 +487,13 @@
           if (l.res != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR, "Can't get CRTC2 layer - %s\n",
                        DirectFBErrorString( l.res ) );
+               uninit();
                return -1;
           }
           if ((res = crtc2->SetCooperativeLevel( crtc2, DLSCL_EXCLUSIVE )) != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to CRTC2 - %s\n",
                        DirectFBErrorString( res ) );
+               uninit();
                return -1;
           }
      }
@@ -495,10 +503,16 @@
                mp_msg( MSGT_VO, MSGL_ERR,
                        "vo_dfbmga: Can't get keyboard - %s\n",
                        DirectFBErrorString( res ) );
+               uninit();
+               return -1;
+          }
+          if ((res = keyboard->CreateEventBuffer( keyboard, &buffer )) != DFB_OK) {
+               mp_msg( MSGT_VO, MSGL_ERR,
+                       "vo_dfbmga: Can't create event buffer - %s\n",
+                       DirectFBErrorString( res ) );
+               uninit();
                return -1;
           }
-          keyboard->CreateEventBuffer( keyboard, &buffer );
-          buffer->Reset( buffer );
      }
 
      return 0;




More information about the MPlayer-cvslog mailing list