]> git.sesse.net Git - vlc/blobdiff - src/misc/win32_specific.c
* src/playlist/item.c: fixed memory leak.
[vlc] / src / misc / win32_specific.c
index 4782f2059cbb0ef14cc8f7f7dc844346bb939f25..36fc102c6c859433b51de886b3f5f262613e1703 100644 (file)
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * win32_specific.c: Win32 specific features
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: win32_specific.c,v 1.27 2003/12/02 12:57:36 gbazin Exp $
+ * Copyright (C) 2001-2004 VideoLAN
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
- *          Gildas Bazin <gbazin@netcourrier.com>
+ *          Gildas Bazin <gbazin@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@
 #include <stdlib.h>                                                /* free() */
 
 #include <vlc/vlc.h>
+#include <vlc/input.h>
 #include "vlc_playlist.h"
 
 #ifdef WIN32                       /* optind, getopt(), included in unistd.h */
@@ -72,6 +73,9 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
     _fmode = _O_BINARY;
     _setmode( _fileno( stdin ), _O_BINARY ); /* Needed for pipes */
 
+    /* Call mdate() once to make sure it is initialized properly */
+    mdate();
+
     /* WinSock Library Init. */
     if( !WSAStartup( MAKEWORD( 2, 0 ), &Data ) )
     {
@@ -106,7 +110,7 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
 
     fprintf( stderr, "error: can't initialize WinSocks\n" );
 
-    return; 
+    return;
 
 #endif
 }
@@ -144,14 +148,14 @@ void system_Configure( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
     {
         HANDLE hmutex;
 
-        msg_Info( p_this, "One instance mode ENABLED");
+        msg_Info( p_this, "one instance mode ENABLED");
 
         /* Use a named mutex to check if another instance is already running */
         if( ( hmutex = CreateMutex( NULL, TRUE, "VLC ipc "VERSION ) ) == NULL )
         {
             /* Failed for some reason. Just ignore the option and go on as
              * normal. */
-            msg_Err( p_this, "One instance mode DISABLED "
+            msg_Err( p_this, "one instance mode DISABLED "
                      "(mutex couldn't be created)" );
             return;
         }
@@ -166,7 +170,7 @@ void system_Configure( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
             if( vlc_thread_create( p_helper, "IPC helper", IPCHelperThread,
                                    VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) )
             {
-                msg_Err( p_this, "One instance mode DISABLED "
+                msg_Err( p_this, "one instance mode DISABLED "
                          "(IPC helper thread couldn't be created)" );
 
             }
@@ -189,7 +193,7 @@ void system_Configure( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
             if( ( ipcwindow = FindWindow( NULL, "VLC ipc "VERSION ) )
                 == NULL )
             {
-                msg_Err( p_this, "One instance mode DISABLED "
+                msg_Err( p_this, "one instance mode DISABLED "
                          "(couldn't find 1st instance of program)" );
                 ReleaseMutex( hmutex );
                 return;
@@ -319,10 +323,11 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
                     i_options++;
                 }
 
-                playlist_Add( p_playlist, ppsz_argv[ i_opt ],
+                playlist_AddExt( p_playlist, ppsz_argv[i_opt],ppsz_argv[i_opt],
+                    PLAYLIST_APPEND | (i_opt? 0 : PLAYLIST_GO),
+                    PLAYLIST_END, -1,
                     (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),
-                    i_options, PLAYLIST_APPEND | (i_opt? 0 : PLAYLIST_GO),
-                    PLAYLIST_END );
+                    i_options );
 
                 i_opt += i_options;
             }