From: Jon Lech Johansen Date: Wed, 14 Nov 2001 00:01:36 +0000 (+0000) Subject: The default file-translation mode was not being set under win32. X-Git-Tag: 0.3.0~403 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6cbaf162518ccb1da55ea3dc0569f392b692d50c;p=vlc The default file-translation mode was not being set under win32. In other words, file playback in 0.2.91 does not work. For de- scheduling threads use a 0ms sleep instead of 1ms, as it was causing problems under WinXP. I hope this does not introduce problems under previous windows versions. I noticed it was originally 0ms, but later changed to 1ms... --- diff --git a/include/threads.h b/include/threads.h index ea684e56bb..57e14f5390 100644 --- a/include/threads.h +++ b/include/threads.h @@ -3,7 +3,7 @@ * This header provides a portable threads implementation. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: threads.h,v 1.25 2001/10/01 12:48:01 massiot Exp $ + * $Id: threads.h,v 1.26 2001/11/14 00:01:36 jlj Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -534,7 +534,7 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar ) && p_condvar->i_waiting_threads == i_waiting_threads ) { PulseEvent( p_condvar->signal ); - Sleep( 1 ); /* deschedule the current thread */ + Sleep( 0 ); /* deschedule the current thread */ } return 0; @@ -608,7 +608,7 @@ static __inline__ int vlc_cond_broadcast( vlc_cond_t *p_condvar ) while( p_condvar->i_waiting_threads ) { PulseEvent( p_condvar->signal ); - Sleep( 1 ); /* deschedule the current thread */ + Sleep( 0 ); /* deschedule the current thread */ } return 0; diff --git a/src/interface/main.c b/src/interface/main.c index 004aed3e01..1f2d4a4b7b 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -4,7 +4,7 @@ * and spawn threads. ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: main.c,v 1.124 2001/11/12 22:42:56 sam Exp $ + * $Id: main.c,v 1.125 2001/11/14 00:01:36 jlj Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -295,9 +295,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) || defined( WIN32 ) system_Init( &i_argc, ppsz_argv, ppsz_env ); -#elif defined( WIN32 ) - _fmode = _O_BINARY; /* sets the default file-translation mode on Win32 */ - #elif defined( SYS_LINUX ) # ifdef DEBUG /* Activate malloc checking routines to detect heap corruptions. */ diff --git a/src/misc/win32_specific.c b/src/misc/win32_specific.c index 01421585fc..798bb4bd28 100644 --- a/src/misc/win32_specific.c +++ b/src/misc/win32_specific.c @@ -2,7 +2,7 @@ * win32_specific.c: Win32 specific features ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: win32_specific.c,v 1.1 2001/11/12 22:42:56 sam Exp $ + * $Id: win32_specific.c,v 1.2 2001/11/14 00:01:36 jlj Exp $ * * Authors: Samuel Hocevar * @@ -24,6 +24,7 @@ #include /* strdup() */ #include /* free() */ +#include #include @@ -48,6 +49,8 @@ void system_Init( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) { fprintf( stderr, "error: can't initiate WinSocks, error %i", i_err ); } + + _fmode = _O_BINARY; /* sets the default file-translation mode */ } /*****************************************************************************