From: Sam Hocevar Date: Wed, 24 Apr 2002 00:36:24 +0000 (+0000) Subject: * ./src/interface/main.c: we no longer segfault if argc == 0. X-Git-Tag: 0.4.0~208 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=08999a39bccd9b1b199294933a54c50e94f4148f * ./src/interface/main.c: we no longer segfault if argc == 0. * ALL: renamed PLUGINS to __PLUGINS__ to avoid conflicts with libraries defining it. Grmbl. * ./src/input/input_ext-plugins.c: cosmetic change. --- diff --git a/INSTALL.win32 b/INSTALL.win32 index 117952b8fc..66552ad34b 100644 --- a/INSTALL.win32 +++ b/INSTALL.win32 @@ -128,7 +128,7 @@ Building Win32 interface with bcc32 (Borland's compiler) 2) From the plugin\win32 directory, use Borland C++ command-line tools as follows: bpr2mak intfwin.bpr -s \ - | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \ + | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \ > intfwin.mak // Create a makefile from intfwin.bpr make -fintfwin // It's Borland's make utility ! diff --git a/Makefile.opts.in b/Makefile.opts.in index 8a5ba96190..52b1ec6e00 100644 --- a/Makefile.opts.in +++ b/Makefile.opts.in @@ -251,8 +251,9 @@ endif # # C compiler flags: plugins and builtins compilation # -plugins_CFLAGS += -DPLUGIN -I../../include -I../../extras -builtins_CFLAGS += -DBUILTIN -I../../include -I../../extras +vlc_CFLAGS += -D__VLC__ +plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras +builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras # # Linker flags: plugins and builtins linking diff --git a/include/audio_output.h b/include/audio_output.h index ea7822462d..beba49e063 100644 --- a/include/audio_output.h +++ b/include/audio_output.h @@ -2,7 +2,7 @@ * audio_output.h : audio output thread interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: audio_output.h,v 1.45 2002/03/26 23:08:40 gbazin Exp $ + * $Id: audio_output.h,v 1.46 2002/04/24 00:36:24 sam Exp $ * * Authors: Michel Kaempf * Cyril Deguet @@ -37,7 +37,7 @@ typedef struct aout_bank_s } aout_bank_t; -#ifndef PLUGIN +#ifndef __PLUGIN__ extern aout_bank_t *p_aout_bank; #else # define p_aout_bank (p_symbols->p_aout_bank) @@ -207,7 +207,7 @@ typedef struct aout_thread_s /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void aout_InitBank ( void ); void aout_EndBank ( void ); diff --git a/include/common.h b/include/common.h index 033f1af377..7226b3946c 100644 --- a/include/common.h +++ b/include/common.h @@ -3,7 +3,7 @@ * Collection of useful common types and macros definitions ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: common.h,v 1.96 2002/04/21 11:23:03 gbazin Exp $ + * $Id: common.h,v 1.97 2002/04/24 00:36:24 sam Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -682,7 +682,7 @@ typedef struct module_symbols_s } module_symbols_t; -#ifdef PLUGIN +#ifdef __PLUGIN__ extern module_symbols_t* p_symbols; #endif diff --git a/include/configuration.h b/include/configuration.h index b4de8cbf9a..31ed23e153 100644 --- a/include/configuration.h +++ b/include/configuration.h @@ -4,7 +4,7 @@ * It includes functions allowing to declare, get or set configuration options. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: configuration.h,v 1.8 2002/04/23 14:16:19 sam Exp $ + * $Id: configuration.h,v 1.9 2002/04/24 00:36:24 sam Exp $ * * Authors: Gildas Bazin * @@ -65,7 +65,7 @@ typedef struct module_config_s * Prototypes - these methods are used to get, set or manipulate configuration * data. *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ int config_GetIntVariable( const char *psz_name ); float config_GetFloatVariable( const char *psz_name ); char * config_GetPszVariable( const char *psz_name ); diff --git a/include/input_ext-dec.h b/include/input_ext-dec.h index ea2657ac15..801f0a54e7 100644 --- a/include/input_ext-dec.h +++ b/include/input_ext-dec.h @@ -2,7 +2,7 @@ * input_ext-dec.h: structures exported to the VideoLAN decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_ext-dec.h,v 1.55 2002/04/23 23:44:36 fenrir Exp $ + * $Id: input_ext-dec.h,v 1.56 2002/04/24 00:36:24 sam Exp $ * * Authors: Christophe Massiot * Michel Kaempf @@ -210,7 +210,7 @@ typedef struct bit_stream_s /***************************************************************************** * Prototypes from input_ext-dec.c *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void InitBitstream ( struct bit_stream_s *, struct decoder_fifo_s *, void (* pf_bitstream_callback)( struct bit_stream_s *, boolean_t ), @@ -542,7 +542,7 @@ typedef struct decoder_config_s /***************************************************************************** * Prototypes from input_dec.c *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void DecoderError ( struct decoder_fifo_s * p_fifo ); #else # define DecoderError p_symbols->DecoderError diff --git a/include/input_ext-intf.h b/include/input_ext-intf.h index 70a95b6bc9..ebeacb4522 100644 --- a/include/input_ext-intf.h +++ b/include/input_ext-intf.h @@ -4,7 +4,7 @@ * control the pace of reading. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: input_ext-intf.h,v 1.64 2002/04/23 14:16:20 sam Exp $ + * $Id: input_ext-intf.h,v 1.65 2002/04/24 00:36:24 sam Exp $ * * Authors: Christophe Massiot * @@ -49,7 +49,7 @@ typedef struct input_bank_s } input_bank_t; -#ifndef PLUGIN +#ifndef __PLUGIN__ extern input_bank_t *p_input_bank; #else # define p_input_bank (p_symbols->p_input_bank) @@ -329,7 +329,7 @@ typedef struct input_thread_s /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void input_InitBank ( void ); void input_EndBank ( void ); diff --git a/include/input_ext-plugins.h b/include/input_ext-plugins.h index f83e04376c..106c9326ba 100644 --- a/include/input_ext-plugins.h +++ b/include/input_ext-plugins.h @@ -3,7 +3,7 @@ * but exported to plug-ins ***************************************************************************** * Copyright (C) 1999-2002 VideoLAN - * $Id: input_ext-plugins.h,v 1.21 2002/03/04 23:56:37 massiot Exp $ + * $Id: input_ext-plugins.h,v 1.22 2002/04/24 00:36:24 sam Exp $ * * Authors: Christophe Massiot * @@ -38,7 +38,7 @@ /***************************************************************************** * Prototypes from input_programs.c *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ int input_InitStream( struct input_thread_s *, size_t ); void input_EndStream ( struct input_thread_s * ); struct pgrm_descriptor_s * input_FindProgram( struct input_thread_s *, u16 ); @@ -73,7 +73,7 @@ int input_UnselectES( struct input_thread_s *, struct es_descriptor_s * ); /***************************************************************************** * Prototypes from input_dec.c *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ //decoder_capabilities_s * input_ProbeDecoder( void ); vlc_thread_t input_RunDecoder( struct input_thread_s *, struct es_descriptor_s * ); @@ -89,7 +89,7 @@ void input_EscapeAudioDiscontinuity( struct input_thread_s * ); /***************************************************************************** * Prototypes from input_clock.c *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void input_ClockInit( struct pgrm_descriptor_s * ); int input_ClockManageControl( struct input_thread_s *, struct pgrm_descriptor_s *, mtime_t ); @@ -104,7 +104,7 @@ mtime_t input_ClockGetTS( struct input_thread_s *, /***************************************************************************** * Prototypes from input_ext-plugins.h (buffers management) *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void * input_BuffersInit( void ); void input_BuffersEnd( struct input_buffers_s * ); struct data_buffer_s * input_NewBuffer( struct input_buffers_s *, size_t ); @@ -283,7 +283,7 @@ typedef struct stream_ps_data_s /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void input_ParsePES ( struct input_thread_s *, struct es_descriptor_s * ); void input_GatherPES ( struct input_thread_s *, struct data_packet_s *, struct es_descriptor_s *, boolean_t, boolean_t ); @@ -323,7 +323,7 @@ typedef struct input_socket_s /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void input_FDClose( struct input_thread_s * ); ssize_t input_FDRead( input_thread_t *, byte_t *, size_t ); ssize_t input_FDNetworkRead( input_thread_t *, byte_t *, size_t ); diff --git a/include/interface.h b/include/interface.h index 95e56afae9..a688c423c9 100644 --- a/include/interface.h +++ b/include/interface.h @@ -4,7 +4,7 @@ * interface, such as message output. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: interface.h,v 1.27 2002/02/19 00:50:18 sam Exp $ + * $Id: interface.h,v 1.28 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * @@ -100,7 +100,7 @@ void intf_Destroy ( intf_thread_t * p_intf ); void intf_MsgCreate ( void ); void intf_MsgDestroy ( void ); -#ifndef PLUGIN +#ifndef __PLUGIN__ intf_subscription_t* intf_MsgSub ( void ); void intf_MsgUnsub ( intf_subscription_t * ); #else diff --git a/include/intf_eject.h b/include/intf_eject.h index 71e7c1de82..0a65a6c762 100644 --- a/include/intf_eject.h +++ b/include/intf_eject.h @@ -2,7 +2,7 @@ * intf_eject.h: CD/DVD-ROM ejection handling functions ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: intf_eject.h,v 1.1 2002/01/09 02:01:14 sam Exp $ + * $Id: intf_eject.h,v 1.2 2002/04/24 00:36:24 sam Exp $ * * Author: Julien Blache * @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ int intf_Eject( const char * ); #else # define intf_Eject p_symbols->intf_Eject diff --git a/include/intf_msg.h b/include/intf_msg.h index c55fb9eaf7..873d9b02e9 100644 --- a/include/intf_msg.h +++ b/include/intf_msg.h @@ -4,7 +4,7 @@ * interface, such as message output. See config.h for output configuration. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: intf_msg.h,v 1.18 2002/02/19 00:50:19 sam Exp $ + * $Id: intf_msg.h,v 1.19 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * @@ -26,7 +26,7 @@ /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void intf_Msg ( char *psz_format, ... ); void intf_ErrMsg ( char *psz_format, ... ); void intf_WarnMsg ( int i_level, char *psz_format, ... ); diff --git a/include/intf_playlist.h b/include/intf_playlist.h index 050abf1435..0294467ad4 100644 --- a/include/intf_playlist.h +++ b/include/intf_playlist.h @@ -2,7 +2,7 @@ * intf_playlist.h : Playlist functions ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: intf_playlist.h,v 1.5 2001/12/30 07:09:54 sam Exp $ + * $Id: intf_playlist.h,v 1.6 2002/04/24 00:36:24 sam Exp $ * * Authors: Samuel Hocevar * @@ -69,7 +69,7 @@ typedef struct playlist_s /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ playlist_t * intf_PlaylistCreate ( void ); void intf_PlaylistInit ( playlist_t * p_playlist ); int intf_PlaylistAdd ( playlist_t * p_playlist, diff --git a/include/iso_lang.h b/include/iso_lang.h index 5960506a08..bbcc5ea1fe 100644 --- a/include/iso_lang.h +++ b/include/iso_lang.h @@ -2,7 +2,7 @@ * iso_lang.h: function to decode language code (in dvd or a52 for instance). ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: iso_lang.h,v 1.2 2001/12/30 07:09:54 sam Exp $ + * $Id: iso_lang.h,v 1.3 2002/04/24 00:36:24 sam Exp $ * * Author: Stéphane Borel * @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ char * DecodeLanguage( u16 ); #else # define DecodeLanguage p_symbols->DecodeLanguage diff --git a/include/main.h b/include/main.h index 70d79203ac..9b3862a452 100644 --- a/include/main.h +++ b/include/main.h @@ -3,7 +3,7 @@ * Declaration and extern access to global program object. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: main.h,v 1.33 2002/03/21 07:11:57 gbazin Exp $ + * $Id: main.h,v 1.34 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * @@ -69,7 +69,7 @@ typedef struct main_s vlc_mutex_t config_lock; /* lock for the config file */ } main_t; -#ifndef PLUGIN +#ifndef __PLUGIN__ extern main_t *p_main; #else # define p_main (p_symbols->p_main) diff --git a/include/modules.h b/include/modules.h index faae707de3..7638f7fafe 100644 --- a/include/modules.h +++ b/include/modules.h @@ -2,7 +2,7 @@ * modules.h : Module management functions. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.h,v 1.47 2002/04/19 13:56:10 sam Exp $ + * $Id: modules.h,v 1.48 2002/04/24 00:36:24 sam Exp $ * * Authors: Samuel Hocevar * @@ -96,7 +96,7 @@ typedef struct module_bank_s it is to design thread-safe linked lists */ } module_bank_t; -#ifndef PLUGIN +#ifndef __PLUGIN__ extern module_bank_t *p_module_bank; #else # define p_module_bank (p_symbols->p_module_bank) @@ -335,7 +335,7 @@ typedef struct module_functions_s * p_module_functions_t; /***************************************************************************** * Exported functions. *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void module_InitBank ( void ); void module_LoadMain ( void ); void module_LoadBuiltins ( void ); diff --git a/include/modules_inner.h b/include/modules_inner.h index a06e1e9a5e..9d2d149cc5 100644 --- a/include/modules_inner.h +++ b/include/modules_inner.h @@ -2,7 +2,7 @@ * modules_inner.h : Macros used from within a module. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules_inner.h,v 1.15 2002/04/23 14:16:20 sam Exp $ + * $Id: modules_inner.h,v 1.16 2002/04/24 00:36:24 sam Exp $ * * Authors: Samuel Hocevar * @@ -38,7 +38,7 @@ * #define MODULE_STRING "foo" * #define MODULE_VAR(blah) "VLC_MODULE_foo_blah" * - * and, if BUILTIN is set, we will also need: + * and, if __BUILTIN__ is set, we will also need: * #define MODULE_FUNC( zog ) module_foo_zog * * this can't easily be done with the C preprocessor, thus a few ugly hacks. @@ -55,7 +55,7 @@ /* If the module is built-in, then we need to define foo_InitModule instead * of InitModule. Same for Activate- and DeactivateModule. */ -#ifdef BUILTIN +#ifdef __BUILTIN__ # define _M( function ) CONCATENATE( function, MODULE_NAME ) # define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME ) # define DECLARE_SYMBOLS ; diff --git a/include/mtime.h b/include/mtime.h index 0fa3c4c812..c435769a2a 100644 --- a/include/mtime.h +++ b/include/mtime.h @@ -9,7 +9,7 @@ * Functions prototyped are implemented in interface/mtime.c. ***************************************************************************** * Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN - * $Id: mtime.h,v 1.10 2002/01/29 20:11:18 gbazin Exp $ + * $Id: mtime.h,v 1.11 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * @@ -50,7 +50,7 @@ /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ char * mstrtime ( char *psz_buffer, mtime_t date ); mtime_t mdate ( void ); void mwait ( mtime_t date ); diff --git a/include/netutils.h b/include/netutils.h index 552a94e0ff..bd0612cdba 100644 --- a/include/netutils.h +++ b/include/netutils.h @@ -4,7 +4,7 @@ * modules. ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: netutils.h,v 1.18 2001/12/30 07:09:54 sam Exp $ + * $Id: netutils.h,v 1.19 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * Henri Fallon @@ -33,7 +33,7 @@ struct sockaddr_in; int network_BuildAddr ( struct sockaddr_in *, char *, int ); -#ifndef PLUGIN +#ifndef __PLUGIN__ int network_ChannelJoin ( int ); int network_ChannelCreate ( void ); #else diff --git a/include/os_specific.h b/include/os_specific.h index 80c54b2a64..6e39125839 100644 --- a/include/os_specific.h +++ b/include/os_specific.h @@ -2,7 +2,7 @@ * os_specific.h: OS specific features ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: os_specific.h,v 1.1 2002/04/02 23:43:57 gbazin Exp $ + * $Id: os_specific.h,v 1.2 2002/04/24 00:36:24 sam Exp $ * * Authors: Samuel Hocevar * Gildas Bazin @@ -41,7 +41,7 @@ extern "C" { ****************************************************************************/ struct main_sys_s; -#ifndef PLUGIN +#ifndef __PLUGIN__ extern struct main_sys_s *p_main_sys; #else # define p_main_sys (p_symbols->p_main_sys) diff --git a/include/video_output.h b/include/video_output.h index e54664b5c9..d981456425 100644 --- a/include/video_output.h +++ b/include/video_output.h @@ -5,7 +5,7 @@ * thread, and destroy a previously opened video output thread. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_output.h,v 1.73 2002/04/04 05:08:05 sam Exp $ + * $Id: video_output.h,v 1.74 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * @@ -39,7 +39,7 @@ typedef struct vout_bank_s } vout_bank_t; -#ifndef PLUGIN +#ifndef __PLUGIN__ extern vout_bank_t *p_vout_bank; #else # define p_vout_bank (p_symbols->p_vout_bank) @@ -189,7 +189,7 @@ typedef struct vout_thread_s /***************************************************************************** * Prototypes *****************************************************************************/ -#ifndef PLUGIN +#ifndef __PLUGIN__ void vout_InitBank ( void ); void vout_EndBank ( void ); diff --git a/include/videolan/vlc.h b/include/videolan/vlc.h index 41e1e153ad..3bc61b93ed 100644 --- a/include/videolan/vlc.h +++ b/include/videolan/vlc.h @@ -2,7 +2,7 @@ * vlc.h: global header for vlc ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: vlc.h,v 1.6 2002/04/02 23:43:57 gbazin Exp $ + * $Id: vlc.h,v 1.7 2002/04/24 00:36:24 sam Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -26,21 +26,26 @@ /***************************************************************************** * Required vlc headers *****************************************************************************/ -#include "defs.h" -#include "config.h" +#if defined( __VLC__ ) || defined( __PLUGIN__ ) || defined( __BUILTIN__ ) +# include "defs.h" +# include "config.h" -#if defined( PLUGIN ) || defined( BUILTIN ) -# include "modules_inner.h" -#endif +# if defined( __PLUGIN__ ) || defined( __BUILTIN__ ) +# include "modules_inner.h" +# endif + +# include "common.h" -#include "common.h" +# include "os_specific.h" -#include "os_specific.h" +# include "intf_msg.h" +# include "threads.h" +# include "mtime.h" +# include "modules.h" + +# include "main.h" +# include "configuration.h" +#endif -#include "intf_msg.h" -#include "threads.h" -#include "mtime.h" -#include "modules.h" +int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ); -#include "main.h" -#include "configuration.h" diff --git a/plugins/win32/Makefile b/plugins/win32/Makefile index 938d21a60b..e13b09a692 100644 --- a/plugins/win32/Makefile +++ b/plugins/win32/Makefile @@ -11,6 +11,6 @@ intfwin_CUSTOM = yes ../intfwin.so: Makefile rm -f intfwin.mak - $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak + $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak $(BCBUILDER)/Bin/make -f intfwin.mak -b diff --git a/src/input/input_ext-plugins.c b/src/input/input_ext-plugins.c index 50f6ea6eb6..a96532e73a 100644 --- a/src/input/input_ext-plugins.c +++ b/src/input/input_ext-plugins.c @@ -2,7 +2,7 @@ * input_ext-plugins.c: useful functions for access and demux plug-ins ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: input_ext-plugins.c,v 1.5 2002/04/02 22:46:25 massiot Exp $ + * $Id: input_ext-plugins.c,v 1.6 2002/04/24 00:36:24 sam Exp $ * * Authors: Christophe Massiot * @@ -726,7 +726,7 @@ static __inline__ int NetworkSelect( input_thread_t * p_input ) i_ret = select( p_access_data->i_handle + 1, &fds, NULL, NULL, &timeout ); - if( i_ret == -1 ) + if( i_ret == -1 && errno != EINTR ) { intf_ErrMsg( "input error: network select error (%s)", strerror(errno) ); } diff --git a/src/interface/intf_msg.c b/src/interface/intf_msg.c index 7be9155daa..d17fa554d6 100644 --- a/src/interface/intf_msg.c +++ b/src/interface/intf_msg.c @@ -4,7 +4,7 @@ * interface, such as message output. See config.h for output configuration. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: intf_msg.c,v 1.47 2002/03/20 23:00:15 gbazin Exp $ + * $Id: intf_msg.c,v 1.48 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * @@ -291,10 +291,10 @@ void intf_WarnHexDump( int i_level, void *p_data, int i_size ) /***************************************************************************** * QueueMsg: add a message to a queue ***************************************************************************** - * This function provide basic functionnalities to other intf_*Msg functions. - * It add a message to a queue (after having printed all stored messages if it - * is full. If the message can't be converted to string in memory, it exit the - * program. If the queue is not used, it prints the message immediately. + * This function provides basic functionnalities to other intf_*Msg functions. + * It adds a message to a queue (after having printed all stored messages if it + * is full). If the message can't be converted to string in memory, it issues + * a warning. *****************************************************************************/ static void QueueMsg( int i_type, int i_level, char *psz_format, va_list ap ) { @@ -319,7 +319,7 @@ static void QueueMsg( int i_type, int i_level, char *psz_format, va_list ap ) strerror(errno) ); vfprintf(stderr, psz_format, ap ); fprintf(stderr, "\n" ); - exit( errno ); + return; } #ifndef HAVE_VASPRINTF diff --git a/src/interface/main.c b/src/interface/main.c index 71032974c6..99d4c867fa 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -4,7 +4,7 @@ * and spawn threads. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: main.c,v 1.186 2002/04/23 14:16:21 sam Exp $ + * $Id: main.c,v 1.187 2002/04/24 00:36:24 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -89,7 +89,7 @@ * macros. * *****************************************************************************/ -#define BUILTIN +#define __BUILTIN__ #define MODULE_NAME main #include "modules_inner.h" /* for configuration stuff */ @@ -542,11 +542,18 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) /* Get the executable name (similar to the basename command) */ - p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ]; - while( *p_tmp ) + if( i_argc > 0 ) { - if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp; - else ++p_tmp; + p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ]; + while( *p_tmp ) + { + if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp; + else ++p_tmp; + } + } + else + { + p_main->psz_arg0 = "vlc"; } /*