* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: interface.h,v 1.37 2002/11/11 14:39:11 sam Exp $
+ * $Id: interface.h,v 1.38 2003/02/06 23:59:40 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#define intf_Create(a) __intf_Create(VLC_OBJECT(a))
-VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t * ) );
+#define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
+VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t *,
+ const char * ) );
VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.3 2002/08/12 09:34:15 sam Exp $
+ * $Id: demux.c,v 1.4 2003/02/06 23:59:40 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
input_thread_t *p_input = (input_thread_t *)p_this;
dvd_data_t * p_dvd = (dvd_data_t *)p_input->p_access_data;
demux_sys_t * p_demux;
- char * psz_intf = NULL;
if( p_input->stream.i_method != INPUT_METHOD_DVD )
{
- return -1;
+ return VLC_EGENERIC;
}
p_demux = p_input->p_demux_data = malloc( sizeof(demux_sys_t ) );
if( p_demux == NULL )
{
- return -1;
+ return VLC_ENOMEM;
}
p_input->p_private = (void*)&p_demux->mpeg;
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
- return -1;
+ return VLC_ENOMOD;
}
p_input->p_demux_data->p_dvd = p_dvd;
p_input->pf_demux = Demux;
p_input->pf_rewind = NULL;
- psz_intf = config_GetPsz( p_input, "intf" );
- config_PutPsz( p_input, "intf", "dvdplay" );
- p_dvd->p_intf = intf_Create( p_input );
+ p_dvd->p_intf = intf_Create( p_input, "dvdplay" );
p_dvd->p_intf->b_block = VLC_FALSE;
intf_RunThread( p_dvd->p_intf );
-
- if( psz_intf != NULL )
- {
- config_PutPsz( p_input, "intf", psz_intf );
- }
- return 0;
+ return VLC_SUCCESS;
}
/*****************************************************************************
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.23 2003/01/23 10:25:40 gbazin Exp $
+ * $Id: rc.c,v 1.24 2003/02/06 23:59:40 sam Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_newintf;
- char *psz_oldmodule = config_GetPsz( p_this->p_vlc, "intf" );
- config_PutPsz( p_this->p_vlc, "intf", newval.psz_string );
- p_newintf = intf_Create( p_this->p_vlc );
- config_PutPsz( p_this->p_vlc, "intf", psz_oldmodule );
-
- if( psz_oldmodule )
- {
- free( psz_oldmodule );
- }
+ p_newintf = intf_Create( p_this->p_vlc, newval.psz_string );
if( p_newintf )
{
* menu.cpp: functions to handle menu items
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: menu.cpp,v 1.12 2003/02/01 22:21:44 ipkiss Exp $
+ * $Id: menu.cpp,v 1.13 2003/02/06 23:59:40 sam Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
AnsiString IntfName = CleanCaption( Item->Caption );
intf_thread_t *p_newintf;
- char *psz_oldmodule = config_GetPsz( p_intf->p_vlc, "intf" );
- config_PutPsz( p_intf->p_vlc, "intf", IntfName.c_str() );
- p_newintf = intf_Create( p_intf->p_vlc );
- config_PutPsz( p_intf->p_vlc, "intf", psz_oldmodule );
-
- if( psz_oldmodule )
- {
- free( psz_oldmodule );
- }
+ p_newintf = intf_Create( p_intf->p_vlc, IntfName.c_str() );
if( p_newintf )
{
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: interface.c,v 1.101 2002/11/10 18:04:23 sam Exp $
+ * $Id: interface.c,v 1.102 2003/02/06 23:59:40 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
* This function opens output devices and creates specific interfaces. It sends
* its own error messages.
*****************************************************************************/
-intf_thread_t* __intf_Create( vlc_object_t *p_this )
+intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module )
{
intf_thread_t * p_intf;
+ char *psz_intf;
/* Allocate structure */
p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF );
return NULL;
}
+ /* XXX: workaround for a bug in VLC 0.5.0 where the dvdplay plugin was
+ * registering itself in $interface, which we do not want to happen. */
+ psz_intf = config_GetPsz( p_intf, "interface" );
+ if( psz_intf )
+ {
+ if( !strcasecmp( psz_intf, "dvdplay" ) )
+ {
+ config_PutPsz( p_intf, "interface", "" );
+ }
+ free( psz_intf );
+ }
+
/* Choose the best module */
- p_intf->p_module = module_Need( p_intf, "interface", "$intf" );
+ p_intf->p_module = module_Need( p_intf, "interface", psz_module );
if( p_intf->p_module == NULL )
{
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.62 2003/02/01 23:39:02 sam Exp $
+ * $Id: libvlc.c,v 1.63 2003/02/06 23:59:40 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
int i_err;
intf_thread_t *p_intf;
vlc_t *p_vlc;
- char *psz_oldmodule = NULL;
p_vlc = i_object ? vlc_object_get( &libvlc, i_object ) : p_static_vlc;
return VLC_ENOOBJ;
}
- if( psz_module )
- {
- psz_oldmodule = config_GetPsz( p_vlc, "intf" );
- config_PutPsz( p_vlc, "intf", psz_module );
- }
-
/* Try to create the interface */
- p_intf = intf_Create( p_vlc );
-
- if( psz_module )
- {
- config_PutPsz( p_vlc, "intf", psz_oldmodule );
- if( psz_oldmodule )
- {
- free( psz_oldmodule );
- }
- }
+ p_intf = intf_Create( p_vlc, psz_module ? psz_module : "$intf" );
if( p_intf == NULL )
{