Commit 254c175a authored by Sam Hocevar's avatar Sam Hocevar

  * Minor compile fix under Hurd.
  * Fixed a potential segfault if the subtitle stream was encountered
    before the video stream.
parent 36901709
...@@ -408,6 +408,12 @@ ...@@ -408,6 +408,12 @@
/* Better be in advance when awakening than late... */ /* Better be in advance when awakening than late... */
#define VOUT_MWAIT_TOLERANCE ((int)(0.020*CLOCK_FREQ)) #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 */ /* The default video output window title */
#define VOUT_TITLE "VideoLAN Client @VLC_VERSION@" #define VOUT_TITLE "VideoLAN Client @VLC_VERSION@"
...@@ -424,12 +430,6 @@ ...@@ -424,12 +430,6 @@
#define VPAR_IDLE_SLEEP ((int)(0.010*CLOCK_FREQ)) #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 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
* that raising this level dramatically lengthens the compilation time. */ * that raising this level dramatically lengthens the compilation time. */
#ifdef RELEASE #ifdef RELEASE
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* This header provides a portable threads implementation. * This header provides a portable threads implementation.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@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, ...@@ -939,7 +939,8 @@ static __inline__ void _vlc_thread_join( char * psz_file, int i_line,
i_ret = pthread_join( thread, NULL ); i_ret = pthread_join( thread, NULL );
#elif defined( HAVE_CTHREADS_H ) #elif defined( HAVE_CTHREADS_H )
i_ret = cthread_join( thread ); cthread_join( thread );
i_ret = 1;
#elif defined( HAVE_KERNEL_SCHEDULER_H ) #elif defined( HAVE_KERNEL_SCHEDULER_H )
int32 exit_value; int32 exit_value;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing * vpar_headers.c : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -782,7 +782,7 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -782,7 +782,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
{ {
return; return;
} }
msleep( VPAR_OUTMEM_SLEEP ); msleep( VOUT_OUTMEM_SLEEP );
} }
/* Initialize values. */ /* Initialize values. */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread * spu_decoder.c : spu decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -187,34 +187,29 @@ static int spu_dec_Run( decoder_config_t * p_config ) ...@@ -187,34 +187,29 @@ static int spu_dec_Run( decoder_config_t * p_config )
*****************************************************************************/ *****************************************************************************/
static int spu_dec_Init( spudec_thread_t *p_spudec ) static int spu_dec_Init( spudec_thread_t *p_spudec )
{ {
int i_retry = 0;
/* Spawn a video output if there is none */ /* Spawn a video output if there is none */
vlc_mutex_lock( &p_vout_bank->lock ); 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" ); vlc_mutex_unlock( &p_vout_bank->lock );
p_spudec->p_vout = vout_CreateThread( NULL, 0, 0 );
/* Everything failed */ if( i_retry++ > 10 )
if( p_spudec->p_vout == NULL )
{ {
intf_Msg( "spudec: can't open vout, aborting" ); intf_WarnMsg( 1, "spudec: waited too long for vout, aborting" );
vlc_mutex_unlock( &p_vout_bank->lock );
free( p_spudec ); free( p_spudec );
return( -1 ); return( -1 );
} }
p_vout_bank->pp_vout[ p_vout_bank->i_count ] = p_spudec->p_vout; msleep( VOUT_OUTMEM_SLEEP );
p_vout_bank->i_count++; vlc_mutex_lock( &p_vout_bank->lock );
} }
else
{ /* Take the first video output FIXME: take the best one */
/* Take the first video output FIXME: take the best one */ p_spudec->p_vout = p_vout_bank->pp_vout[ 0 ];
p_spudec->p_vout = p_vout_bank->pp_vout[ 0 ];
}
vlc_mutex_unlock( &p_vout_bank->lock ); vlc_mutex_unlock( &p_vout_bank->lock );
p_spudec->p_config->pf_init_bit_stream( p_spudec->p_config->pf_init_bit_stream(
&p_spudec->bit_stream, &p_spudec->bit_stream,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment