* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: spu_decoder.c,v 1.36 2001/04/25 09:31:14 sam Exp $
+ * $Id: spu_decoder.c,v 1.39 2001/05/01 12:22:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "defs.h"
#include <unistd.h> /* getpid() */
+#ifdef WIN32 /* getpid() for win32 is located in process.h */
+#include <process.h>
+#endif
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* memcpy(), memset() */
#include "spu_decoder.h"
+#include "main.h" /* XXX: remove this later */
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
* Initialize the thread properties
*/
p_spudec->p_config = p_config;
+
p_spudec->p_fifo = p_config->decoder_config.p_decoder_fifo;
- /* Get the video output informations */
- p_spudec->p_vout = p_config->p_vout;
+ /* XXX: The vout request and fifo opening will eventually be here */
+ if( p_spudec->p_vout == NULL )
+ {
+ if( p_main->p_vout == NULL )
+ {
+ intf_Msg( "vpar: no vout present, spawning one" );
+ p_main->p_vout = vout_CreateThread( NULL );
+ }
+
+ p_spudec->p_vout = p_main->p_vout;
+ }
/* Spawn the spu decoder thread */
if ( vlc_thread_create(&p_spudec->thread_id, "spu decoder",
{
p_spudec->p_config->decoder_config.pf_init_bit_stream(
&p_spudec->bit_stream,
- p_spudec->p_config->decoder_config.p_decoder_fifo );
+ p_spudec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
/* Mark thread as running and return */
return( 0 );