/*****************************************************************************
* 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
#include <stdlib.h> /* free() */
#include <vlc/vlc.h>
+#include <vlc/input.h>
#include "vlc_playlist.h"
#ifdef WIN32 /* optind, getopt(), included in unistd.h */
_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 ) )
{
fprintf( stderr, "error: can't initialize WinSocks\n" );
- return;
+ return;
#endif
}
{
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;
}
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)" );
}
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;
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;
}