]> git.sesse.net Git - vlc/commitdiff
* Minor compile fix under Hurd.
authorSam Hocevar <sam@videolan.org>
Thu, 13 Dec 2001 23:56:18 +0000 (23:56 +0000)
committerSam Hocevar <sam@videolan.org>
Thu, 13 Dec 2001 23:56:18 +0000 (23:56 +0000)
  * Fixed a potential segfault if the subtitle stream was encountered
    before the video stream.

include/config.h.in
include/threads.h
plugins/mpeg_vdec/vpar_headers.c
plugins/spu_dec/spu_decoder.c

index c50c2d90a4343fb45064af6e848c1cf803e9edd9..b2ba24b0d2437d73788f71932d56d53a724ea89f 100644 (file)
 /* Better be in advance when awakening than late... */
 #define VOUT_MWAIT_TOLERANCE            ((int)(0.020*CLOCK_FREQ))
 
+/* Time to sleep when waiting for a buffer (from vout or the video fifo).
+ * It should be approximately the time needed to perform a complete picture
+ * loop. Since it only happens when the video heap is full, it does not need
+ * to be too low, even if it blocks the decoder. */
+#define VOUT_OUTMEM_SLEEP               ((int)(0.020*CLOCK_FREQ))
+
 /* The default video output window title */
 #define VOUT_TITLE                      "VideoLAN Client @VLC_VERSION@"
 
 
 #define VPAR_IDLE_SLEEP                 ((int)(0.010*CLOCK_FREQ))
 
-/* Time to sleep when waiting for a buffer (from vout or the video fifo).
- * It should be approximately the time needed to perform a complete picture
- * loop. Since it only happens when the video heap is full, it does not need
- * to be too low, even if it blocks the decoder. */
-#define VPAR_OUTMEM_SLEEP               ((int)(0.020*CLOCK_FREQ))
-
 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
  * that raising this level dramatically lengthens the compilation time. */
 #ifdef RELEASE
index 6163fa7127d45e00494b83ee4abdc840756fdc8f..4a20906f1244beabe1066f7b56a53b6ab6936537 100644 (file)
@@ -3,7 +3,7 @@
  * This header provides a portable threads implementation.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: threads.h,v 1.31 2001/12/03 13:58:59 massiot Exp $
+ * $Id: threads.h,v 1.31.2.1 2001/12/13 23:56:18 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -939,7 +939,8 @@ static __inline__ void _vlc_thread_join( char * psz_file, int i_line,
     i_ret = pthread_join( thread, NULL );
 
 #elif defined( HAVE_CTHREADS_H )
-    i_ret = cthread_join( thread );
+    cthread_join( thread );
+    i_ret = 1;
 
 #elif defined( HAVE_KERNEL_SCHEDULER_H )
     int32 exit_value;
index 76ce2b3f618b5a2f34ffd1c295e5a81b5221636e..e66a0f04c3169b8cdbf8d5fdf19b804d7f1c5112 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.2.2.1 2001/12/10 10:59:14 massiot Exp $
+ * $Id: vpar_headers.c,v 1.2.2.2 2001/12/13 23:56:18 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -782,7 +782,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
             {
                 return;
             }
-            msleep( VPAR_OUTMEM_SLEEP );
+            msleep( VOUT_OUTMEM_SLEEP );
         }
 
         /* Initialize values. */
index 8fbafb6282d33abdd8665207ef812b6e20cf5584..a9eab6a0abea4ef49452c038088529eca09b97ca 100644 (file)
@@ -2,7 +2,7 @@
  * spu_decoder.c : spu decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.5 2001/12/03 16:18:37 sam Exp $
+ * $Id: spu_decoder.c,v 1.5.2.1 2001/12/13 23:56:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -187,34 +187,29 @@ static int spu_dec_Run( decoder_config_t * p_config )
  *****************************************************************************/
 static int spu_dec_Init( spudec_thread_t *p_spudec )
 {
+    int i_retry = 0;
+
     /* Spawn a video output if there is none */
     vlc_mutex_lock( &p_vout_bank->lock );
 
-    if( p_vout_bank->i_count == 0 )
+    while( p_vout_bank->i_count == 0 )
     {
-        intf_WarnMsg( 1, "spudec: no vout present, spawning one" );
-
-        p_spudec->p_vout = vout_CreateThread( NULL, 0, 0 );
+        vlc_mutex_unlock( &p_vout_bank->lock );
 
-        /* Everything failed */
-        if( p_spudec->p_vout == NULL )
+        if( i_retry++ > 10 )
         {
-            intf_Msg( "spudec: can't open vout, aborting" );
-            vlc_mutex_unlock( &p_vout_bank->lock );
+            intf_WarnMsg( 1, "spudec: waited too long for vout, aborting" );
             free( p_spudec );
 
             return( -1 );
         }
 
-        p_vout_bank->pp_vout[ p_vout_bank->i_count ] = p_spudec->p_vout;
-        p_vout_bank->i_count++;
+        msleep( VOUT_OUTMEM_SLEEP );
+        vlc_mutex_lock( &p_vout_bank->lock );
     }
-    else
-    {
-        /* Take the first video output FIXME: take the best one */
-        p_spudec->p_vout = p_vout_bank->pp_vout[ 0 ];
-    }
-
+    
+    /* Take the first video output FIXME: take the best one */
+    p_spudec->p_vout = p_vout_bank->pp_vout[ 0 ];
     vlc_mutex_unlock( &p_vout_bank->lock );
     p_spudec->p_config->pf_init_bit_stream(
             &p_spudec->bit_stream,