]> git.sesse.net Git - vlc/blobdiff - modules/video_output/x11/xcommon.c
Check malloc return value when needed and don't print an error when such error happend.
[vlc] / modules / video_output / x11 / xcommon.c
index b8230349d4942c115bacbd8c4754100845ca3540..be72fc9bb0620f86f8939267d09d07a9aa1d7669 100644 (file)
@@ -98,8 +98,8 @@
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-int  E_(Activate)   ( vlc_object_t * );
-void E_(Deactivate) ( vlc_object_t * );
+int  Activate   ( vlc_object_t * );
+void Deactivate ( vlc_object_t * );
 
 static int  InitVideo      ( vout_thread_t * );
 static void EndVideo       ( vout_thread_t * );
@@ -178,7 +178,7 @@ static const int i_backlight_on_interval = 300;
  * vout properties to choose the window size, and change them according to the
  * actual properties of the display.
  *****************************************************************************/
-int E_(Activate) ( vlc_object_t *p_this )
+int Activate ( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
     char *        psz_display;
@@ -206,10 +206,7 @@ int E_(Activate) ( vlc_object_t *p_this )
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
-    {
-        msg_Err( p_vout, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     vlc_mutex_init( &p_vout->p_sys->lock );
 
@@ -429,7 +426,7 @@ int E_(Activate) ( vlc_object_t *p_this )
     if( checkXvMCCap( p_vout ) == VLC_EGENERIC )
     {
         msg_Err( p_vout, "no XVMC capability found" );
-        E_(Deactivate)( p_vout );
+        Deactivate( p_vout );
         return VLC_EGENERIC;
     }
     subpicture_t sub_pic;
@@ -464,7 +461,7 @@ int E_(Activate) ( vlc_object_t *p_this )
  *****************************************************************************
  * Terminate an output method created by Open
  *****************************************************************************/
-void E_(Deactivate) ( vlc_object_t *p_this )
+void Deactivate ( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
@@ -1493,17 +1490,8 @@ static int ManageVideo( vout_thread_t *p_vout )
      */
     if ( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
     {
-        vlc_value_t val_fs, val_ontop;
-
         /* Update the object variable and trigger callback */
-        val_fs.b_bool = !p_vout->b_fullscreen;
-
-        var_Set( p_vout, "fullscreen", val_fs );
-
-        /* Disable "always on top" in fullscreen mode */
-        var_Get( p_vout, "video-on-top", &val_ontop );
-        if( val_ontop.b_bool )
-            WindowOnTop( p_vout, val_fs.b_bool );
+        var_SetBool( p_vout, "fullscreen", !p_vout->b_fullscreen );
 
         ToggleFullScreen( p_vout );
         p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
@@ -2951,10 +2939,7 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
     p_data = malloc( i_bytes_per_line * i_height );
 #endif
     if( !p_data )
-    {
-        msg_Err( p_vout, "out of memory" );
         return NULL;
-    }
 
 #ifdef MODULE_NAME_IS_x11
     /* Optimize the quantum of a scanline regarding its size - the quantum is
@@ -3018,8 +3003,13 @@ static int X11ErrorHandler( Display * display, XErrorEvent * event )
         return i_shm_major = 0;
 #endif
 
+#ifndef HAVE_OSSO
     XSetErrorHandler(NULL);
     return (XSetErrorHandler(X11ErrorHandler))( display, event );
+#else
+    /* Work-around Maemo Xvideo bug */
+    return 0;
+#endif
 }
 
 #ifdef MODULE_NAME_IS_x11