Commit f7c92985 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/access/dvdplay/demux.c: the dvdplay plugin no longer sets the

    "interface" variable to "dvdplay" (Closes: #178, #210, and probably a
    bunch of others).
  * ./src/interface/interface.c: added a safety check to circumvent the bug,
    allowing a smooth upgrade.
parent 901bde54
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as message output. * interface, such as message output.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -53,8 +53,9 @@ struct intf_thread_t ...@@ -53,8 +53,9 @@ struct intf_thread_t
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
#define intf_Create(a) __intf_Create(VLC_OBJECT(a)) #define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t * ) ); VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t *,
const char * ) );
VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) ); VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) ); VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) ); VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* demux.c: demux functions for dvdplay. * demux.c: demux functions for dvdplay.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * 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: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -79,17 +79,16 @@ int E_(InitDVD) ( vlc_object_t *p_this ) ...@@ -79,17 +79,16 @@ int E_(InitDVD) ( vlc_object_t *p_this )
input_thread_t *p_input = (input_thread_t *)p_this; input_thread_t *p_input = (input_thread_t *)p_this;
dvd_data_t * p_dvd = (dvd_data_t *)p_input->p_access_data; dvd_data_t * p_dvd = (dvd_data_t *)p_input->p_access_data;
demux_sys_t * p_demux; demux_sys_t * p_demux;
char * psz_intf = NULL;
if( p_input->stream.i_method != INPUT_METHOD_DVD ) 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 ) ); p_demux = p_input->p_demux_data = malloc( sizeof(demux_sys_t ) );
if( p_demux == NULL ) if( p_demux == NULL )
{ {
return -1; return VLC_ENOMEM;
} }
p_input->p_private = (void*)&p_demux->mpeg; p_input->p_private = (void*)&p_demux->mpeg;
...@@ -97,7 +96,7 @@ int E_(InitDVD) ( vlc_object_t *p_this ) ...@@ -97,7 +96,7 @@ int E_(InitDVD) ( vlc_object_t *p_this )
if( p_demux->p_module == NULL ) if( p_demux->p_module == NULL )
{ {
free( p_input->p_demux_data ); free( p_input->p_demux_data );
return -1; return VLC_ENOMOD;
} }
p_input->p_demux_data->p_dvd = p_dvd; p_input->p_demux_data->p_dvd = p_dvd;
...@@ -105,18 +104,11 @@ int E_(InitDVD) ( vlc_object_t *p_this ) ...@@ -105,18 +104,11 @@ int E_(InitDVD) ( vlc_object_t *p_this )
p_input->pf_demux = Demux; p_input->pf_demux = Demux;
p_input->pf_rewind = NULL; p_input->pf_rewind = NULL;
psz_intf = config_GetPsz( p_input, "intf" ); p_dvd->p_intf = intf_Create( p_input, "dvdplay" );
config_PutPsz( p_input, "intf", "dvdplay" );
p_dvd->p_intf = intf_Create( p_input );
p_dvd->p_intf->b_block = VLC_FALSE; p_dvd->p_intf->b_block = VLC_FALSE;
intf_RunThread( p_dvd->p_intf ); intf_RunThread( p_dvd->p_intf );
if( psz_intf != NULL )
{
config_PutPsz( p_input, "intf", psz_intf );
}
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* rc.c : remote control stdin/stdout plugin for vlc * rc.c : remote control stdin/stdout plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
* *
...@@ -662,16 +662,8 @@ static int Intf( vlc_object_t *p_this, char const *psz_cmd, ...@@ -662,16 +662,8 @@ static int Intf( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
intf_thread_t *p_newintf; 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, 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 );
}
if( p_newintf ) if( p_newintf )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menu.cpp: functions to handle menu items * menu.cpp: functions to handle menu items
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * 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> * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
* *
...@@ -97,16 +97,8 @@ void __fastcall TMenusGen::InterfaceModuleClick( TObject *Sender ) ...@@ -97,16 +97,8 @@ void __fastcall TMenusGen::InterfaceModuleClick( TObject *Sender )
AnsiString IntfName = CleanCaption( Item->Caption ); AnsiString IntfName = CleanCaption( Item->Caption );
intf_thread_t *p_newintf; 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, 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 );
}
if( p_newintf ) if( p_newintf )
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as command line. * interface, such as command line.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -53,9 +53,10 @@ static void Manager( intf_thread_t *p_intf ); ...@@ -53,9 +53,10 @@ static void Manager( intf_thread_t *p_intf );
* This function opens output devices and creates specific interfaces. It sends * This function opens output devices and creates specific interfaces. It sends
* its own error messages. * 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; intf_thread_t * p_intf;
char *psz_intf;
/* Allocate structure */ /* Allocate structure */
p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF ); p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF );
...@@ -65,8 +66,20 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this ) ...@@ -65,8 +66,20 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this )
return NULL; 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 */ /* 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 ) if( p_intf->p_module == NULL )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -547,7 +547,6 @@ int VLC_AddIntf( int i_object, char const *psz_module, vlc_bool_t b_block ) ...@@ -547,7 +547,6 @@ int VLC_AddIntf( int i_object, char const *psz_module, vlc_bool_t b_block )
int i_err; int i_err;
intf_thread_t *p_intf; intf_thread_t *p_intf;
vlc_t *p_vlc; vlc_t *p_vlc;
char *psz_oldmodule = NULL;
p_vlc = i_object ? vlc_object_get( &libvlc, i_object ) : p_static_vlc; p_vlc = i_object ? vlc_object_get( &libvlc, i_object ) : p_static_vlc;
...@@ -556,23 +555,8 @@ int VLC_AddIntf( int i_object, char const *psz_module, vlc_bool_t b_block ) ...@@ -556,23 +555,8 @@ int VLC_AddIntf( int i_object, char const *psz_module, vlc_bool_t b_block )
return VLC_ENOOBJ; 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 */ /* Try to create the interface */
p_intf = intf_Create( p_vlc ); p_intf = intf_Create( p_vlc, psz_module ? psz_module : "$intf" );
if( psz_module )
{
config_PutPsz( p_vlc, "intf", psz_oldmodule );
if( psz_oldmodule )
{
free( psz_oldmodule );
}
}
if( p_intf == NULL ) if( p_intf == NULL )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment