* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.111 2001/05/28 04:23:52 sam Exp $
+ * $Id: input.c,v 1.113 2001/05/30 17:03:12 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
static void DestroyThread ( input_thread_t *p_input );
static void EndThread ( input_thread_t *p_input );
+static void FileOpen ( input_thread_t *p_input );
+static void FileClose ( input_thread_t *p_input );
+static void NetworkOpen ( input_thread_t *p_input );
+static void NetworkClose ( input_thread_t *p_input );
+
/*****************************************************************************
* input_CreateThread: creates a new input thread
*****************************************************************************
p_input->stream.control.b_mute = 0;
p_input->stream.control.b_bw = 0;
+ /* Setup callbacks */
+ p_input->pf_file_open = FileOpen;
+ p_input->pf_file_close = FileClose;
+#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
+ p_input->pf_network_open = NetworkOpen;
+ p_input->pf_network_close = NetworkClose;
+#endif
+
/* Create thread and set locks. */
vlc_mutex_init( &p_input->stream.stream_lock );
vlc_cond_init( &p_input->stream.stream_wait );
}
/*****************************************************************************
- * input_FileOpen : open a file descriptor
+ * FileOpen : open a file descriptor
*****************************************************************************/
-void input_FileOpen( input_thread_t * p_input )
+static void FileOpen( input_thread_t * p_input )
{
struct stat stat_info;
int i_stat;
}
/*****************************************************************************
- * input_FileClose : close a file descriptor
+ * FileClose : close a file descriptor
*****************************************************************************/
-void input_FileClose( input_thread_t * p_input )
+static void FileClose( input_thread_t * p_input )
{
intf_WarnMsg( 1, "input: closing file `%s'", p_input->p_source );
close( p_input->i_handle );
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
/*****************************************************************************
- * input_NetworkOpen : open a network socket
+ * NetworkOpen : open a network socket
*****************************************************************************/
-void input_NetworkOpen( input_thread_t * p_input )
+static void NetworkOpen( input_thread_t * p_input )
{
char *psz_server = NULL;
char *psz_broadcast = NULL;
if( psz_broadcast == NULL )
{
/* Are we broadcasting ? */
- psz_broadcast = main_GetPszVariable( INPUT_BROADCAST_VAR, NULL );
+ if( main_GetIntVariable( INPUT_BROADCAST_VAR,
+ INPUT_BROADCAST_DEFAULT ) )
+ {
+ psz_broadcast = main_GetPszVariable( INPUT_BCAST_ADDR_VAR,
+ INPUT_BCAST_ADDR_DEFAULT );
+ }
+ else
+ {
+ psz_broadcast = NULL;
+ }
}
intf_WarnMsg( 2, "input: server: %s port: %d broadcast: %s",
}
/*****************************************************************************
- * input_NetworkClose : close a network socket
+ * NetworkClose : close a network socket
*****************************************************************************/
-void input_NetworkClose( input_thread_t * p_input )
+static void NetworkClose( input_thread_t * p_input )
{
close( p_input->i_handle );