vlc with MS and Intel C/C++ compilers.
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: common.h,v 1.32 2001/05/30 17:03:11 sam Exp $
+ * $Id: common.h,v 1.33 2001/05/31 01:37:08 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
#ifdef NTOHL_IN_SYS_PARAM_H
# include <sys/param.h>
#elif defined(WIN32)
+# include <winsock.h>
#else
# include <netinet/in.h>
#endif
#define U32_AT(p) ( ntoh32 ( *( (u32 *)(p) ) ) )
#define U16_AT(p) ( ntoh16 ( *( (u16 *)(p) ) ) )
+/* win32, cl and icl support */
+#if defined( _MSC_VER )
+typedef long off_t;
+#define __attribute__(x)
+#define __inline__ __inline
+#define strncasecmp strnicmp
+#define strcasecmp stricmp
+#define S_ISBLK(m) (0)
+#define S_ISCHR(m) (0)
+#define S_ISFIFO(m) (((m)&_S_IFMT) == _S_IFIFO)
+#define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG)
+#define I64C(x) x
+#else
+#define I64C(x) x##LL
+#endif
* int_types.h: internal types
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: int_types.h,v 1.6 2001/03/21 13:42:33 sam Exp $
+ * $Id: int_types.h,v 1.7 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
typedef signed short s16;
typedef unsigned int u32;
typedef signed int s32;
+#if defined( _MSC_VER )
+typedef unsigned __int64 u64;
+typedef signed __int64 s64;
+#else
typedef unsigned long long u64;
typedef signed long long s64;
+#endif
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_msg.h,v 1.13 2001/04/30 15:00:59 massiot Exp $
+ * $Id: intf_msg.h,v 1.14 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
#else
/* Non-TRACE mode */
+#if defined( _MSC_VER )
+#define intf_DbgMsg
+#define intf_DbgMsgImm
+#else
#define intf_DbgMsg( format, args... )
#define intf_DbgMsgImm( format, args...)
+#endif
#endif
--- /dev/null
+/*****************************************************************************
+ * iovec.h: iovec structure and readv() replacement
+ *****************************************************************************
+ * Copyright (C) 2001 VideoLAN
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Jon Lech Johansen <jon-vl@nanocrew.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * iovec structure: vectored data entry
+ *****************************************************************************/
+struct iovec
+{
+ void *iov_base; /* Pointer to data. */
+ size_t iov_len; /* Length of data. */
+};
+
+#if defined( WIN32 )
+/*****************************************************************************
+ * readv: readv() replacement for iovec-impaired C libraries
+ *****************************************************************************/
+static __inline int readv( int i_fd, struct iovec *p_iovec, int i_count )
+{
+ int i_index, i_len, i_total = 0;
+ char *p_base;
+
+ for( i_index = i_count; i_index; i_index-- )
+ {
+ register signed int i_bytes;
+
+ i_len = p_iovec->iov_len;
+ p_base = p_iovec->iov_base;
+
+ /* Loop is unrolled one time to spare the (i_bytes < 0) test */
+ if( i_len > 0 )
+ {
+ i_bytes = read( i_fd, p_base, i_len );
+
+ if( ( i_total == 0 ) && ( i_bytes < 0 ) )
+ {
+ return -1;
+ }
+
+ if( i_bytes <= 0 )
+ {
+ return i_total;
+ }
+
+ i_len -= i_bytes;
+ i_total += i_bytes;
+ p_base += i_bytes;
+
+ while( i_len > 0 )
+ {
+ i_bytes = read( i_fd, p_base, i_len );
+
+ if( i_bytes <= 0 )
+ {
+ return i_total;
+ }
+
+ i_len -= i_bytes;
+ i_total += i_bytes;
+ p_base += i_bytes;
+ }
+ }
+
+ p_iovec++;
+ }
+
+ return i_total;
+}
+
+#endif
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: aout_dummy.c,v 1.11 2001/05/30 17:03:12 sam Exp $
+ * $Id: aout_dummy.c,v 1.12 2001/05/31 01:37:08 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
typedef struct aout_sys_s
{
-
+#if defined( _MSC_VER )
+ int i_dummy;
+#endif
} aout_sys_t;
/*****************************************************************************
* intf_dummy.c: dummy interface plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: intf_dummy.c,v 1.8 2001/05/30 17:03:12 sam Exp $
+ * $Id: intf_dummy.c,v 1.9 2001/05/31 01:37:08 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
typedef struct intf_sys_s
{
-
+#if defined( _MSC_VER )
+ int i_dummy;
+#endif
} intf_sys_t;
/*****************************************************************************
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_css.c,v 1.29 2001/05/19 00:39:29 stef Exp $
+ * $Id: dvd_css.c,v 1.30 2001/05/31 01:37:08 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
#include <string.h>
#include "common.h"
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ifo.c,v 1.27 2001/05/19 00:39:29 stef Exp $
+ * $Id: dvd_ifo.c,v 1.28 2001/05/31 01:37:08 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
#include <string.h>
#include <fcntl.h>
* dvd_ioctl.c: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ioctl.c,v 1.14 2001/05/27 15:16:58 sam Exp $
+ * $Id: dvd_ioctl.c,v 1.15 2001/05/31 01:37:08 sam Exp $
*
* Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
* Samuel Hocevar <sam@zoy.org>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h>
-#include <netinet/in.h>
+#if !defined( WIN32 )
+#include <netinet/in.h>
#include <sys/ioctl.h>
+#endif
#ifdef DVD_STRUCT_IN_SYS_CDIO_H
# include <sys/cdio.h>
* will only be given back to netlist when refcount is zero.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
- * $Id: dvd_netlist.c,v 1.5 2001/04/06 09:15:47 sam Exp $
+ * $Id: dvd_netlist.c,v 1.6 2001/05/31 01:37:08 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
* Stéphane Borel <stef@videolan.org>
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h>
-#include <sys/uio.h> /* struct iovec */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
+#include <sys/uio.h> /* struct iovec */
+#else
+#include <io.h>
+#include "iovec.h"
+#endif
#include "config.h"
#include "common.h"
* found in .ifo.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_summary.c,v 1.1 2001/05/19 00:39:30 stef Exp $
+ * $Id: dvd_summary.c,v 1.2 2001/05/31 01:37:08 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
#include <netinet/in.h>
+#endif
#include <fcntl.h>
#include <sys/types.h>
-#include <sys/uio.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
* contains the basic udf handling functions
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_udf.c,v 1.6 2001/04/28 03:36:25 sam Exp $
+ * $Id: dvd_udf.c,v 1.7 2001/05/31 01:37:08 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
#include "modules_inner.h"
#include <stdio.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.62 2001/05/30 22:16:07 sam Exp $
+ * $Id: input_dvd.c,v 1.63 2001/05/31 01:37:08 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
#include <netinet/in.h>
+#endif
#include <fcntl.h>
#include <sys/types.h>
-#include <sys/uio.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
#endif
#include <errno.h>
+#if !defined( WIN32 )
+#include <sys/uio.h> /* struct iovec */
+#else
+#include <io.h>
+#include "iovec.h"
+#endif
+
#include "config.h"
#include "common.h"
#include "threads.h"
thread_dvd_data_t * p_dvd;
dvd_netlist_t * p_netlist;
struct iovec * p_vec;
- struct data_packet_s * pp_data[p_input->i_read_once];
+ struct data_packet_s ** pp_data;
u8 * pi_cur;
int i_block_once;
int i_packet_size;
boolean_t b_eof;
boolean_t b_eot;
+ pp_data = (struct data_packet_s **) malloc( p_input->i_read_once *
+ sizeof( struct data_packet_s * ) );
+ if( pp_data == NULL )
+ {
+ intf_ErrMsg( "dvd error: out of memory" );
+ return -1;
+ }
+
p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data;
if( ( p_vec = DVDGetiovec( p_netlist ) ) == NULL )
{
intf_ErrMsg( "dvd error: can't get iovec" );
+ free( pp_data );
return -1;
}
{
pp_packets[0] = NULL;
intf_ErrMsg( "dvd error: can't find next cell" );
+ free( pp_data );
return 1;
}
while( i_pos < p_netlist->i_buffer_size )
{
- pi_cur = (u8*)(p_vec[i_iovec].iov_base + i_pos);
+ pi_cur = ((u8*)p_vec[i_iovec].iov_base + i_pos);
/*default header */
if( U32_AT( pi_cur ) != 0x1BA )
else
{
intf_ErrMsg( "Unable to determine stream type" );
+ free( pp_data );
return( -1 );
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
+ free( pp_data );
+
if( b_eof )
{
return 1;
* input_es.c: Elementary Stream demux and packet management
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_es.c,v 1.3 2001/05/30 17:03:12 sam Exp $
+ * $Id: input_es.c,v 1.4 2001/05/31 01:37:08 sam Exp $
*
* Authors:
*
#include <sys/types.h>
#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
#include <fcntl.h>
#include "config.h"
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ps.c,v 1.25 2001/05/30 17:03:12 sam Exp $
+ * $Id: input_ps.c,v 1.26 2001/05/31 01:37:08 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
#include <sys/types.h>
#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
#include <fcntl.h>
#include "config.h"
* input_ps.h: thread structure of the PS plugin
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ps.h,v 1.6 2001/05/08 00:43:57 sam Exp $
+ * $Id: input_ps.h,v 1.7 2001/05/31 01:37:08 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+#if defined( _MSC_VER )
+#undef small
+#endif
+
/*****************************************************************************
* thread_ps_data_t: extension of input_thread_t
*****************************************************************************/
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ts.c,v 1.21 2001/05/30 17:03:12 sam Exp $
+ * $Id: input_ts.c,v 1.22 2001/05/31 01:37:08 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
#include <errno.h>
#include <sys/types.h>
+
+#if !defined( _MSC_VER )
#include <sys/time.h>
+#endif
#ifdef SYS_NTO
#include <sys/select.h>
#endif
-#ifndef WIN32
-# include <sys/uio.h> /* struct iovec */
-#else
- struct iovec
- {
- void *iov_base; /* Pointer to data. */
- size_t iov_len; /* Length of data. */
- };
-#endif
-
#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
#include <fcntl.h>
+#if !defined( WIN32 )
+#include <sys/uio.h> /* struct iovec */
+#else
+#include <io.h>
+#include "iovec.h"
+#endif
+
#include "config.h"
#include "common.h"
#include "threads.h"
* input_ts.h: structures of the input not exported to other modules
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ts.h,v 1.5 2001/05/28 04:23:52 sam Exp $
+ * $Id: input_ts.h,v 1.6 2001/05/31 01:37:08 sam Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
*
fd_set s_fdset;
} thread_ts_data_t;
-
-#ifdef WIN32
-static __inline__ int readv( int i_fd, struct iovec *p_iovec, int i_count )
-{
- int i_index, i_len, i_total = 0;
- char *p_base;
-
- for( i_index = i_count; i_index; i_index-- )
- {
- i_len = p_iovec->iov_len;
- p_base = p_iovec->iov_base;
-
- while( i_len > 0 )
- {
- register signed int i_bytes;
- i_bytes = read( i_fd, p_base, i_len );
-
- if( i_total == 0 )
- {
- if( i_bytes < 0 )
- {
- intf_ErrMsg( "input error: read failed on socket" );
- return -1;
- }
- }
-
- if( i_bytes <= 0 )
- {
- return i_total;
- }
-
- i_len -= i_bytes;
- i_total += i_bytes;
- p_base += i_bytes;
- }
-
- p_iovec++;
- }
-
- return i_total;
-}
-#endif
-
* ac3_decoder_thread.c: ac3 decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder_thread.c,v 1.33 2001/05/15 16:19:42 sam Exp $
+ * $Id: ac3_decoder_thread.c,v 1.34 2001/05/31 01:37:08 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
*****************************************************************************/
#include "defs.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* memset() */
* ac3_iec958.c: ac3 to spdif converter
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_iec958.c,v 1.4 2001/05/06 18:32:30 stef Exp $
+ * $Id: ac3_iec958.c,v 1.5 2001/05/31 01:37:08 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
#include <stdlib.h>
#include <string.h> /* memset() */
#include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include "config.h"
#include "common.h"
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.6 2001/05/30 05:19:03 stef Exp $
+ * $Id: ac3_spdif.c,v 1.7 2001/05/31 01:37:08 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
#include <stdlib.h>
#include <string.h> /* memcpy() */
#include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include "config.h"
#include "common.h"
m_last_pts;
/* Write in the first free packet of aout fifo */
- p_spdif->p_iec = (p_spdif->p_aout_fifo->buffer) +
- (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE );
+ p_spdif->p_iec = ((u8*)(p_spdif->p_aout_fifo->buffer) +
+ (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE ));
/* Build burst to be sent to hardware decoder */
ac3_iec958_build_burst( p_spdif );
* audio_decoder.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_decoder.c,v 1.50 2001/05/01 04:18:18 sam Exp $
+ * $Id: audio_decoder.c,v 1.51 2001/05/31 01:37:08 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
*****************************************************************************/
#include "defs.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
#include <stdio.h> /* "intf_msg.h" */
#include <string.h> /* memcpy(), memset() */
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.c,v 1.8 2001/05/30 23:02:04 stef Exp $
+ * $Id: aout_spdif.c,v 1.9 2001/05/31 01:37:08 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
mlast = mplay;
/* play spdif frame to the external decoder */
p_aout->pf_play( p_aout,
- p_aout->fifo[i_fifo].buffer +
+ ((byte_t*) p_aout->fifo[i_fifo].buffer +
p_aout->fifo[i_fifo].l_start_frame*
- SPDIF_FRAME_SIZE,
+ SPDIF_FRAME_SIZE ),
p_aout->fifo[i_fifo].l_frame_size );
p_aout->fifo[i_fifo].l_start_frame =
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: audio_output.c,v 1.62 2001/05/30 05:19:03 stef Exp $
+ * $Id: audio_output.c,v 1.63 2001/05/31 01:37:08 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
*****************************************************************************/
#include "defs.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
+
#ifdef WIN32 /* getpid() for win32 is located in process.h */
#include <process.h>
#endif
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.114 2001/05/30 22:16:07 sam Exp $
+ * $Id: input.c,v 1.115 2001/05/31 01:37:08 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
static void RunThread( input_thread_t *p_input )
{
int i_error, i;
+ data_packet_t ** pp_packets;
if( InitThread( p_input ) )
{
p_input->stream.b_changed = 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
- while( !p_input->b_die && !p_input->b_error && !p_input->b_eof )
+ pp_packets = (data_packet_t **) malloc( p_input->i_read_once *
+ sizeof( data_packet_t * ) );
+ if( pp_packets == NULL )
{
- data_packet_t * pp_packets[p_input->i_read_once];
+ intf_ErrMsg( "input error: out of memory" );
+ p_input->b_error = 1;
+ }
+ while( !p_input->b_die && !p_input->b_error && !p_input->b_eof )
+ {
#ifdef STATS
p_input->c_loops++;
#endif
}
}
+ free( pp_packets );
+
if( p_input->b_error || p_input->b_eof )
{
ErrorThread( p_input );
/* We may want to reuse an already used socket */
i_opt = 1;
if( setsockopt( p_input->i_handle, SOL_SOCKET, SO_REUSEADDR,
- &i_opt, sizeof( i_opt ) ) == -1 )
+ (void*) &i_opt, sizeof( i_opt ) ) == -1 )
{
intf_ErrMsg( "input error: can't configure socket (SO_REUSEADDR: %s)",
strerror(errno));
* packet loss caused by scheduling problems */
i_opt = 0x80000;
if( setsockopt( p_input->i_handle, SOL_SOCKET, SO_RCVBUF,
- &i_opt, sizeof( i_opt ) ) == -1 )
+ (void*) &i_opt, sizeof( i_opt ) ) == -1 )
{
intf_ErrMsg( "input error: can't configure socket (SO_RCVBUF: %s)",
strerror(errno));
* input_netlist.c: netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_netlist.c,v 1.37 2001/05/28 04:23:52 sam Exp $
+ * $Id: input_netlist.c,v 1.38 2001/05/31 01:37:08 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
-#ifndef WIN32
-# include <sys/uio.h> /* struct iovec */
+#if !defined( WIN32 )
+#include <sys/uio.h> /* struct iovec */
#else
- struct iovec
- {
- void *iov_base; /* Pointer to data. */
- size_t iov_len; /* Length of data. */
- };
+#include <io.h>
+#include "iovec.h"
#endif
#include "config.h"
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: intf_msg.c,v 1.34 2001/05/07 03:14:09 stef Exp $
+ * $Id: intf_msg.c,v 1.35 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
#include <stdarg.h> /* va_list for BSD */
#include <stdlib.h> /* malloc() */
#include <string.h> /* strerror() */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* close(), write() */
+#endif
#include "config.h"
#include "common.h"
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: main.c,v 1.98 2001/05/30 23:02:04 stef Exp $
+ * $Id: main.c,v 1.99 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <netinet/in.h> /* BSD: struct in_addr */
#endif
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* getenv(), strtol(), */
#include <string.h> /* strerror() */
* lpcm_decoder_thread.c: lpcm decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: lpcm_decoder_thread.c,v 1.14 2001/05/01 04:18:18 sam Exp $
+ * $Id: lpcm_decoder_thread.c,v 1.15 2001/05/31 01:37:08 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
#include "defs.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
#include <stdio.h> /* "intf_msg.h" */
#include <string.h> /* memcpy(), memset() */
* modules.c : Built-in and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.31 2001/05/30 17:03:12 sam Exp $
+ * $Id: modules.c,v 1.32 2001/05/31 01:37:08 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* sprintf() */
#include <string.h> /* strdup() */
+
+#if !defined( _MSC_VER )
#include <dirent.h>
+#endif
#if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */
# include <dlfcn.h> /* dlopen(), dlsym(), dlclose() */
* Functions are prototyped in mtime.h.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: mtime.c,v 1.18 2001/05/07 04:42:42 sam Exp $
+ * $Id: mtime.c,v 1.19 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
#include "defs.h"
#include <stdio.h> /* sprintf() */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* select() */
+#endif
+
+#if !defined( _MSC_VER )
#include <sys/time.h>
+#endif
#ifdef HAVE_KERNEL_OS_H
#include <kernel/OS.h>
#endif
-#ifdef WIN32
+#if defined( WIN32 )
#include <windows.h>
#endif
char *mstrtime( char *psz_buffer, mtime_t date )
{
sprintf( psz_buffer, "%02d:%02d:%02d-%03d.%03d",
- (int) (date / (1000LL * 1000LL * 60LL * 60LL) % 24LL),
- (int) (date / (1000LL * 1000LL * 60LL) % 60LL),
- (int) (date / (1000LL * 1000LL) % 60LL),
- (int) (date / 1000LL % 1000LL),
- (int) (date % 1000LL) );
+ (int) (date / (I64C(1000) * I64C(1000) * I64C(60) * I64C(60)) % I64C(24)),
+ (int) (date / (I64C(1000) * I64C(1000) * I64C(60)) % I64C(60)),
+ (int) (date / (I64C(1000) * I64C(1000)) % I64C(60)),
+ (int) (date / I64C(1000) % I64C(1000)),
+ (int) (date % I64C(1000)) );
return( psz_buffer );
}
* netutils.c: various network functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: netutils.c,v 1.35 2001/05/30 23:02:04 stef Exp $
+ * $Id: netutils.c,v 1.36 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr>
#include <stdlib.h> /* free(), realloc(), atoi() */
#include <errno.h> /* errno() */
#include <string.h> /* memset() */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* gethostname() */
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
+#if !defined( _MSC_VER )
#include <sys/time.h> /* gettimeofday */
+#endif
-#ifndef WIN32
+#if !defined( WIN32 )
#include <netdb.h> /* gethostbyname() */
#include <netinet/in.h> /* BSD: struct in_addr */
#include <sys/socket.h> /* BSD: struct sockaddr */
#include <sys/ioctl.h> /* ioctl() */
#endif
-#ifdef WIN32 /* tools to get the MAC adress from */
+#if defined( WIN32 ) /* tools to get the MAC adress from */
#include <windows.h> /* the interface under Windows */
#include <stdio.h>
#endif
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: spu_decoder.c,v 1.45 2001/05/11 15:10:01 sam Exp $
+ * $Id: spu_decoder.c,v 1.46 2001/05/31 01:37:08 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
#include "defs.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
+
#ifdef WIN32 /* getpid() for win32 is located in process.h */
#include <process.h>
#endif
* video_decoder.c : video decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_decoder.c,v 1.50 2001/05/30 17:03:12 sam Exp $
+ * $Id: video_decoder.c,v 1.51 2001/05/31 01:37:08 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gaël Hendryckx <jimmy@via.ecp.fr>
*****************************************************************************/
#include "defs.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
#include <stdlib.h> /* free() */
#include <string.h> /* memcpy(), memset() */
* video_text.c : text manipulation functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_text.c,v 1.26 2001/04/28 03:36:25 sam Exp $
+ * $Id: video_text.c,v 1.27 2001/05/31 01:37:08 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */
#include <fcntl.h> /* open() */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* read(), close() */
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
#ifdef SYS_BEOS
# include "beos_specific.h"
p_font->i_interspacing);
/* compute where to stop... */
- i_end = (int) (i_percent * strlen(psz_text) / 100LL);
+ i_end = (int) (i_percent * strlen(psz_text) / I64C(100));
if(i_end > strlen(psz_text))
i_end = strlen(psz_text);
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.c,v 1.86 2001/05/30 17:03:13 sam Exp $
+ * $Id: video_parser.c,v 1.87 2001/05/31 01:37:08 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
#include "defs.h"
#include <stdlib.h> /* malloc(), free() */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* getpid() */
+#endif
+
#include <errno.h>
#include <string.h>