[vlc-devel] commit: b_daemon does not need to be exported through vlc_global ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat May 3 16:25:24 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Sat May  3 13:49:48 2008 +0300| [0b776c28b4446eed12dcc984b07f5fcae06d4b6d]

b_daemon does not need to be exported through vlc_global

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

 src/libvlc-common.c |   10 ++++++----
 src/libvlc.h        |    3 ---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/libvlc-common.c b/src/libvlc-common.c
index be5033a..e882f76 100644
--- a/src/libvlc-common.c
+++ b/src/libvlc-common.c
@@ -96,11 +96,13 @@
 #include <vlc_vlm.h>
 
 /*****************************************************************************
- * The evil global variable. We handle it with care, don't worry.
+ * The evil global variables. We handle them with care, don't worry.
  *****************************************************************************/
 static libvlc_int_t *    p_static_vlc = NULL;
 static volatile unsigned int i_instances = 0;
 
+static bool b_daemon = false;
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -324,7 +326,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
             msg_Err( p_libvlc, "Unable to fork vlc to daemon mode" );
             b_exit = true;
         }
-        p_libvlc_global->b_daemon = true;
+        b_daemon = true;
 
         /* lets check if we need to write the pidfile */
         psz_pidfile = config_GetPsz( p_libvlc, "pidfile" );
@@ -371,7 +373,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
             close( STDOUT_FILENO );
             close( STDERR_FILENO );
 
-            p_libvlc_global->b_daemon = true;
+            b_daemon = true;
         }
 #endif
     }
@@ -1131,7 +1133,7 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc,
     }
 
 #ifndef WIN32
-    if( vlc_global()->b_daemon && b_block && !psz_module )
+    if( b_daemon && b_block && !psz_module )
     {
         /* Daemon mode hack.
          * We prefer the dummy interface if none is specified. */
diff --git a/src/libvlc.h b/src/libvlc.h
index 1e8f74f..e80ca73 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -120,9 +120,6 @@ struct libvlc_global_data_t
     intf_thread_t         *p_probe;       ///< Devices prober
 
     /* Arch-specific variables */
-#if !defined( WIN32 )
-    bool             b_daemon;
-#endif
 #if defined( SYS_BEOS )
     vlc_object_t *         p_appthread;
     char *                 psz_vlcpath;




More information about the vlc-devel mailing list