X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fwin32_specific.c;h=2808959679a4be3aa811d93987ee0eebfdf966df;hb=e27abe75a1d2017799af345709d0db0bcb172a36;hp=8121458d21f440176aedda76edcff2235f80b91a;hpb=2be071915d0b90bef9edc114818b02c7be830ca4;p=vlc diff --git a/src/misc/win32_specific.c b/src/misc/win32_specific.c index 8121458d21..2808959679 100644 --- a/src/misc/win32_specific.c +++ b/src/misc/win32_specific.c @@ -1,16 +1,17 @@ /***************************************************************************** - * win32_specific.c: Win32 specific features + * win32_specific.c: Win32 specific features ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: win32_specific.c,v 1.4 2001/12/09 17:01:37 sam Exp $ + * $Id: win32_specific.c,v 1.20 2003/01/19 03:16:24 sam Exp $ * * Authors: Samuel Hocevar + * Gildas Bazin * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -20,23 +21,22 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include "defs.h" - #include /* strdup() */ #include /* free() */ -#include - -#include -#include "common.h" +#include -#include "win32_specific.h" +#if !defined( UNDER_CE ) +# include +# include +#endif /***************************************************************************** - * system_Init: initialize winsock. + * system_Init: initialize winsock and misc other things. *****************************************************************************/ -void system_Init( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) +void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] ) { +#if !defined( UNDER_CE ) WSADATA Data; int i_err; @@ -45,17 +45,47 @@ void system_Init( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) if( i_err ) { - fprintf( stderr, "error: can't initiate WinSocks, error %i", i_err ); + fprintf( stderr, "error: can't initiate WinSocks, error %i\n", i_err ); } - _fmode = _O_BINARY; /* sets the default file-translation mode */ + /* Set the default file-translation mode */ + _fmode = _O_BINARY; +#endif +} + +/***************************************************************************** + * system_Configure: check for system specific configuration options. + *****************************************************************************/ +void system_Configure( vlc_t *p_this ) +{ +#if !defined( UNDER_CE ) + p_this->p_libvlc->b_fast_mutex = config_GetInt( p_this, "fast-mutex" ); + p_this->p_libvlc->i_win9x_cv = config_GetInt( p_this, "win9x-cv-method" ); + + /* Raise default priority of the current process */ +#ifndef ABOVE_NORMAL_PRIORITY_CLASS +# define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000 +#endif + if( !SetPriorityClass( GetCurrentProcess(), + ABOVE_NORMAL_PRIORITY_CLASS ) ) + { + if( !SetPriorityClass( GetCurrentProcess(), + HIGH_PRIORITY_CLASS ) ) + msg_Dbg( p_this, "can't raise process priority" ); + else + msg_Dbg( p_this, "raised process priority" ); + } + else + msg_Dbg( p_this, "raised process priority" ); +#endif } /***************************************************************************** * system_End: terminate winsock. *****************************************************************************/ -void system_End( void ) +void system_End( vlc_t *p_this ) { +#if !defined( UNDER_CE ) WSACleanup(); +#endif } -