]> git.sesse.net Git - vlc/commitdiff
The default file-translation mode was not being set under win32.
authorJon Lech Johansen <jlj@videolan.org>
Wed, 14 Nov 2001 00:01:36 +0000 (00:01 +0000)
committerJon Lech Johansen <jlj@videolan.org>
Wed, 14 Nov 2001 00:01:36 +0000 (00:01 +0000)
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...

include/threads.h
src/interface/main.c
src/misc/win32_specific.c

index ea684e56bb3bdecd02bf53e4c47aa80653bf3a2e..57e14f5390466fbdd50a110359a0260bf87d6d50 100644 (file)
@@ -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 <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -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;
 
index 004aed3e01822157e25f92463c20a2a9b591b66a..1f2d4a4b7b40a30f0c64e09d42eb12c57cfd6143 100644 (file)
@@ -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 <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -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. */
index 01421585fcc3a0f8fe6d71145e3e7e6ef205746a..798bb4bd2844d3f34c82bc531f6110b2f9f8a55b 100644 (file)
@@ -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 <sam@zoy.org>
  *
@@ -24,6 +24,7 @@
 
 #include <string.h>                                              /* strdup() */
 #include <stdlib.h>                                                /* free() */
+#include <fcntl.h>
 
 #include <winsock2.h>
 
@@ -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 */
 }
 
 /*****************************************************************************