extra plugin location.
* ./plugins/text/rc.c: if stdin/stdout are not connected to a TTY, we
don't launch the rc interface.
* ./plugins/access/http.c: fixed a compilation warning.
* ./src/misc/messages.c: cosmetic enhancements in the message output.
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: main.h,v 1.38 2002/06/01 17:09:25 sam Exp $
+ * $Id: main.h,v 1.39 2002/06/27 19:05:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/* Locks */
vlc_mutex_t config_lock; /* lock for the config file */
vlc_mutex_t structure_lock; /* lock for the p_vlc tree */
+ int i_unique; /* p_vlc occurence # */
int i_counter; /* object counter */
/* Pointer to the big, evil global lock */
vlc_mutex_t * p_global_lock;
void ** pp_global_data;
- /* Private data */
+ /* System-specific variables */
#if defined( SYS_BEOS )
vlc_object_t * p_appthread;
#elif defined( WIN32 )
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: http.c,v 1.12 2002/06/18 23:18:40 massiot Exp $
+ * $Id: http.c,v 1.13 2002/06/27 19:05:17 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
snprintf( psz_buffer, sizeof(psz_buffer),
"%s"
HTTP_USERAGENT HTTP_END,
- p_access_data->psz_buffer, i_tell );
+ p_access_data->psz_buffer );
}
psz_buffer[sizeof(psz_buffer) - 1] = '\0';
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: avi.c,v 1.23 2002/06/26 23:11:12 fenrir Exp $
+ * $Id: avi.c,v 1.24 2002/06/27 19:05:17 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
#include "video.h"
-/*****************************************************************************
- * Constants
- *****************************************************************************/
+#include "libioRIFF.h"
+#include "avi.h"
/*****************************************************************************
* Local prototypes
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
-/*****************************************************************************
- * Definition of structures and libraries for this plugins
- *****************************************************************************/
-#include "libioRIFF.h"
-#include "avi.h"
-
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
+++ /dev/null
-/*****************************************************************************
- * avi_file.c : AVI file Stream input module for vlc
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: libLE.c,v 1.1 2002/04/23 23:44:36 fenrir Exp $
- * Authors: Laurent Aimar <fenrir@via.ecp.fr>
- *
- * 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.
- *****************************************************************************/
-
-/*
- * Data reading functions
- */
-
-static u16 __GetWordLittleEndianFromBuff( byte_t *p_buff )
-{
- u16 i;
- i = (*p_buff) + ( *(p_buff + 1) <<8 );
- return ( i );
-}
-
-static u32 __GetDoubleWordLittleEndianFromBuff( byte_t *p_buff )
-{
- u32 i;
- i = (*p_buff) + ( *(p_buff + 1) <<8 ) + ( *(p_buff + 2) <<16 ) + ( *(p_buff + 3) <<24 );
- return ( i );
-}
-
-static void __SetWordLittleEndianToBuff( byte_t *p_buff, u16 i)
-{
- *(p_buff) = (i & 0xFF);
- *(p_buff + 1) = ( ( i >>8 ) & 0xFF);
- return;
-}
-
-static void __SetDoubleWordLittleEndianToBuff( byte_t *p_buff, u32 i)
-{
- *(p_buff) = ( i & 0xFF );
- *(p_buff + 1) = (( i >>8 ) & 0xFF);
- *(p_buff + 2) = (( i >>16 ) & 0xFF);
- *(p_buff + 3) = (( i >>24 ) & 0xFF);
- return;
-}
-
-
* libioRIFF.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: libioRIFF.c,v 1.8 2002/06/27 18:10:16 fenrir Exp $
+ * $Id: libioRIFF.c,v 1.9 2002/06/27 19:05:17 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#include <stdlib.h>
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h> /* malloc(), free() */
+
#include <vlc/vlc.h>
#include <vlc/input.h>
-#include <video.h>
+
+#include "video.h"
#include "libioRIFF.h"
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.19 2002/06/07 23:05:03 sam Exp $
+ * $Id: rc.c,v 1.20 2002/06/27 19:05:17 sam Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
*****************************************************************************/
static int intf_Open( intf_thread_t *p_intf )
{
+#ifdef HAVE_ISATTY
+ /* Check that stdin is a TTY */
+ if( !isatty( 0 ) )
+ {
+ msg_Warn( p_intf, "fd 0 is not a TTY" );
+ return 1;
+ }
+#endif
+
/* Non-buffered stdout */
setvbuf( stdout, (char *)NULL, _IOLBF, 0 );
if( p_intf->p_sys == NULL )
{
msg_Err( p_intf, "out of memory" );
- return( 1 );
+ return 1;
}
#ifdef WIN32
#endif
printf( "remote control interface initialized, `h' for help\n" );
- return( 0 );
+ return 0;
}
/*****************************************************************************
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.204 2002/06/08 14:08:46 sam Exp $
+ * $Id: input.c,v 1.205 2002/06/27 19:05:17 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
if( p_input->p_access_module == NULL )
{
- msg_Err( p_input, "no suitable access module for `%s/%s:%s'",
+ msg_Err( p_input, "no suitable access module for `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
return -1;
}
if( p_input->p_demux_module == NULL )
{
- msg_Err( p_input, "no suitable demux module for `%s/%s:%s'",
+ msg_Err( p_input, "no suitable demux module for `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
module_Unneed( p_input->p_access_module );
return -1;
* input_ext-plugins.c: useful functions for access and demux plug-ins
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_ext-plugins.c,v 1.12 2002/06/01 18:04:49 sam Exp $
+ * $Id: input_ext-plugins.c,v 1.13 2002/06/27 19:05:17 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
{
input_socket_t * p_access_data = (input_socket_t *)p_input->p_access_data;
- msg_Info( p_input, "closing `%s/%s:%s'",
+ msg_Info( p_input, "closing `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
close( p_access_data->i_handle );
{
input_socket_t * p_access_data = (input_socket_t *)p_input->p_access_data;
- msg_Info( p_input, "closing network `%s/%s:%s'",
+ msg_Info( p_input, "closing network `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
#ifdef WIN32
* and spawns threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: libvlc.c,v 1.10 2002/06/11 09:44:22 gbazin Exp $
+ * $Id: libvlc.c,v 1.11 2002/06/27 19:05:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* A list of all the currently allocated vlc objects */
static volatile int i_vlc = 0;
+static volatile int i_unique = 0;
static volatile vlc_t **pp_vlc = NULL;
/*****************************************************************************
pp_vlc = realloc( pp_vlc, (i_vlc+1) * sizeof( vlc_t * ) );
pp_vlc[ i_vlc ] = p_vlc;
i_vlc++;
+ p_vlc->i_unique = i_unique;
+ i_unique++;
vlc_mutex_unlock( p_vlc->p_global_lock );
/* Update the handle status */
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.4 2002/06/11 09:44:22 gbazin Exp $
+ * $Id: libvlc.h,v 1.5 2002/06/27 19:05:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
"This option allows you to set the default path that the interface will " \
"open when looking for a file.")
+#define PLUGIN_PATH_TEXT N_("plugin search path")
+#define PLUGIN_PATH_LONGTEXT N_( \
+ "This option allows you to specify an additional path for vlc to look" \
+ "for its plugins.")
+
#define AOUT_TEXT N_("audio output module")
#define AOUT_LONGTEXT N_( \
"This option allows you to select the audio output method used by vlc. " \
ADD_BOOL_WITH_SHORT ( "quiet", 'q', 0, NULL, QUIET_TEXT, QUIET_LONGTEXT )
ADD_BOOL ( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT )
ADD_STRING ( "search-path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT )
+ADD_STRING ( "plugin-path", NULL, NULL, PLUGIN_PATH_TEXT, PLUGIN_PATH_LONGTEXT )
/* Audio options */
ADD_CATEGORY_HINT( N_("Audio"), NULL)
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: messages.c,v 1.2 2002/06/01 18:04:49 sam Exp $
+ * $Id: messages.c,v 1.3 2002/06/27 19:05:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
# define GRAY "\033[0m"
static const char *ppsz_color[4] = { WHITE, RED, YELLOW, GRAY };
- fprintf( stderr, "[" GREEN "%.8x" GRAY "] " "%s%s"
- ": %s%s" GRAY "\n", p_this->i_object_id, psz_module,
- ppsz_type[i_type], ppsz_color[i_type], psz_str );
+ fprintf( stderr, "[" GREEN "%.2x" GRAY ":" GREEN "%.6x" GRAY "] "
+ "%s%s: %s%s" GRAY "\n", p_this->p_vlc->i_unique,
+ p_this->i_object_id, psz_module,
+ ppsz_type[i_type], ppsz_color[i_type], psz_str );
}
else
{
- fprintf( stderr, "[%.8x] %s%s: %s\n", p_this->i_object_id,
+ fprintf( stderr, "[%.2x:%.6x] %s%s: %s\n",
+ p_this->p_vlc->i_unique, p_this->i_object_id,
psz_module, ppsz_type[i_type], psz_str );
}
}
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.68 2002/06/11 09:44:22 gbazin Exp $
+ * $Id: modules.c,v 1.69 2002/06/27 19:05:17 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#ifdef HAVE_DYNAMIC_PLUGINS
static void AllocateAllPlugins( vlc_object_t *p_this )
{
- static char * path[] = { ".", "plugins", PLUGIN_PATH, NULL, NULL };
+ /* Yes, there are two NULLs because we replace one with "plugin-path". */
+ char * path[] = { "plugins", PLUGIN_PATH, NULL, NULL };
char ** ppsz_path = path;
char * psz_fullpath;
DIR * dir;
struct dirent * file;
+ /* If the user provided a plugin path, we add it to the list */
+ path[ sizeof(path)/sizeof(char*) - 2 ] = config_GetPsz( p_this,
+ "plugin-path" );
+
for( ; *ppsz_path != NULL ; ppsz_path++ )
{
/* Store strlen(*ppsz_path) for later use. */
* vlc.c: the vlc player
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vlc.c,v 1.1 2002/06/01 12:32:01 sam Exp $
+ * $Id: vlc.c,v 1.2 2002/06/27 19:05:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* Add background interfaces */
//{ int i; for( i=10; i--; ) vlc_add_intf( p_vlc, "dummy", 0 ); }
- vlc_add_intf( p_vlc, "dummy", VLC_FALSE );
- vlc_add_intf( p_vlc, "logger", VLC_FALSE );
+ //vlc_add_intf( p_vlc, "dummy", VLC_FALSE );
+ //vlc_add_intf( p_vlc, "logger", VLC_FALSE );
vlc_add_intf( p_vlc, "rc", VLC_FALSE );
/* Add a blocking interface */