]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
* modules/video_output/directx/directx.c,glwin32.c: revert backport of 13050 for...
[vlc] / src / libvlc.c
index 69b155b540276c02e012c4feb682737262668be7..2462e084fe0f5dac685a37baa88cbaa761eb2b69 100644 (file)
@@ -402,7 +402,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     if( config_GetInt( p_vlc, "daemon" ) )
     {
 #if HAVE_DAEMON
-        if( daemon( 0, 0) != 0 )
+        if( daemon( 1, 0) != 0 )
         {
             msg_Err( p_vlc, "Unable to fork vlc to daemon mode" );
             b_exit = VLC_TRUE;
@@ -748,10 +748,21 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     }
 
     /*
-     * Allways load the hotkeys interface if it exists
+     * Always load the hotkeys interface if it exists
      */
     VLC_AddIntf( 0, "hotkeys,none", VLC_FALSE, VLC_FALSE );
 
+    /*
+     * If needed, load the Xscreensaver interface
+     * Currently, only for X
+     */
+#ifdef HAVE_X11_XLIB_H
+    if( config_GetInt( p_vlc, "disable-screensaver" ) == 1 )
+    {
+        VLC_AddIntf( 0, "screensaver", VLC_FALSE, VLC_FALSE );
+    }
+#endif
+
     /*
      * FIXME: kludge to use a p_vlc-local variable for the Mozilla plugin
      */
@@ -767,8 +778,6 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     var_Create( p_vlc, "drawableh", VLC_VAR_INTEGER );
     var_Create( p_vlc, "drawableportx", VLC_VAR_INTEGER );
     var_Create( p_vlc, "drawableporty", VLC_VAR_INTEGER );
-    var_Create( p_vlc, "width", VLC_VAR_INTEGER );
-    var_Create( p_vlc, "height", VLC_VAR_INTEGER );
 
     /*
      * Get input filenames given as commandline arguments
@@ -2436,6 +2445,9 @@ static void ShowConsole( void )
 
     AllocConsole();
 
+    freopen( "CONOUT$", "w", stderr );
+    freopen( "CONIN$", "r", stdin );
+
     if( (f_help = fopen( "vlc-help.txt", "wt" )) )
     {
         fclose( f_help );
@@ -2445,9 +2457,6 @@ static void ShowConsole( void )
 
     else freopen( "CONOUT$", "w", stdout );
 
-    freopen( "CONOUT$", "w", stderr );
-    freopen( "CONIN$", "r", stdin );
-
 #   endif
 }
 #endif
@@ -2603,8 +2612,9 @@ char *FromLocale( const char *locale )
         while( vlc_iconv( libvlc.from_locale, &iptr, &inb, &optr, &outb )
                                                                == (size_t)-1 )
         {
-            *optr++ = '?';
-            *iptr++;
+            *optr = '?';
+            optr++;
+            iptr++;
             vlc_iconv( libvlc.from_locale, NULL, NULL, NULL, NULL );
         }
         vlc_mutex_unlock( &libvlc.from_locale_lock );
@@ -2643,8 +2653,9 @@ char *ToLocale( const char *utf8 )
         while( vlc_iconv( libvlc.to_locale, &iptr, &inb, &optr, &outb )
                                                                == (size_t)-1 )
         {
-            *optr++ = '?'; /* should not happen, and yes, it sucks */
-            *iptr++;
+            *optr = '?'; /* should not happen, and yes, it sucks */
+            optr++;
+            iptr++;
             vlc_iconv( libvlc.to_locale, NULL, NULL, NULL, NULL );
         }
         vlc_mutex_unlock( &libvlc.to_locale_lock );