Commit eb505a2f authored by Gildas Bazin's avatar Gildas Bazin

* ALL: changes to the playlist_Add() and VLC_AddTarget() proto to include a list of options associated with the input.
* src/input/input.c: parses the input options list before spawning the input and create object variables for these options. Options are of the form "[no[-]]foo[=bar]" where foo is the option name and bar is its value.
* src/input/input.c, src/input/input_dec.c: use the object var api to get the value of the "sout", "sout-video" and "sout-audio" options.
* src/libvlc.c: extended the command line parser to parse input options. Input options must always follow the input they apply to and begin with a ':'.

All these changes allow you to specify input specific options.
eg: ./vlc --no-sout-audio yourvideo.mpeg :sout=udp/http::8080 :sout-audio yourvideo2.mpeg
Here the ":sout" option will only apply to yourvideo.mpeg.
"--no-sout-audio" will be a global option so will apply to yourvideo2.mpeg but the global behaviour is overriden by ":sout-audio" for yourvideo.mpeg.

TODO: - the interfaces need to be modified to benefit from the new playlist_Add() api.
      - only "sout", "sout-video", "sout-audio" implemented for now. To make it work with other options, we need to get rid of all the config_GetFoo() and replace them with var_Create()/var_Change()/var_Get().
parent 19e6278e
......@@ -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.27 2003/05/12 17:33:19 gbazin Exp $
* $Id: configuration.h,v 1.28 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -82,6 +82,7 @@ struct module_config_t
* Prototypes - these methods are used to get, set or manipulate configuration
* data.
*****************************************************************************/
VLC_EXPORT( int, __config_GetType, (vlc_object_t *, const char *) );
VLC_EXPORT( int, __config_GetInt, (vlc_object_t *, const char *) );
VLC_EXPORT( void, __config_PutInt, (vlc_object_t *, const char *, int) );
VLC_EXPORT( float, __config_GetFloat, (vlc_object_t *, const char *) );
......@@ -103,6 +104,7 @@ VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
VLC_EXPORT( void, config_SetCallbacks, ( module_config_t *, module_config_t * ) );
VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
#define config_GetType(a,b) __config_GetType(VLC_OBJECT(a),b)
#define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
#define config_PutInt(a,b,c) __config_PutInt(VLC_OBJECT(a),b,c)
#define config_GetFloat(a,b) __config_GetFloat(VLC_OBJECT(a),b)
......
......@@ -2,7 +2,7 @@
* vlc.h: global header for vlc
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.23 2003/05/05 15:21:28 sigmunau Exp $
* $Id: vlc.h,v 1.24 2003/07/23 01:13:47 gbazin Exp $
*
* 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
......@@ -42,7 +42,9 @@ typedef union
void * p_address;
vlc_object_t * p_object;
vlc_list_t * p_list;
struct { int i_low, i_high; } time;
struct { char *psz_name; int i_object_id; } var;
/* Make sure the structure is at least 64bits */
struct { char a, b, c, d, e, f, g, h; } padding;
......@@ -133,7 +135,7 @@ int VLC_Destroy ( int );
int VLC_Set ( int, char const *, vlc_value_t );
int VLC_Get ( int, char const *, vlc_value_t * );
int VLC_AddIntf ( int, char const *, vlc_bool_t );
int VLC_AddTarget ( int, char const *, int, int );
int VLC_AddTarget ( int, char const *, const char **, int, int, int );
int VLC_Play ( int );
int VLC_Pause ( int );
......
......@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.10 2003/06/27 10:31:02 zorglub Exp $
* $Id: vlc_playlist.h,v 1.11 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -28,6 +28,8 @@ struct playlist_item_t
{
char * psz_name;
char * psz_uri;
char ** ppsz_options;
int i_options;
int i_type; /* unused yet */
int i_status; /* unused yet */
vlc_bool_t b_autodeletion;
......@@ -76,8 +78,8 @@ void playlist_Destroy ( playlist_t * );
#define playlist_Goto(p,i) playlist_Command(p,PLAYLIST_GOTO,i)
VLC_EXPORT( void, playlist_Command, ( playlist_t *, int, int ) );
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, int, int ) );
VLC_EXPORT( int, playlist_AddName, (playlist_t *,const char *,const char *, int,int ) );
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char **, int, int, int ) );
VLC_EXPORT( int, playlist_AddName, (playlist_t *,const char *,const char *, const char **, int, int,int ) );
VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) );
VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_Move, ( playlist_t *, int, int ) );
......
......@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.37 2003/07/16 15:32:40 sam Exp $
* $Id: http.c,v 1.38 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -341,7 +341,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
i_code, psz_answer, psz_value );
p_playlist->pp_items[p_playlist->i_index]->b_autodeletion
= VLC_TRUE;
playlist_Add( p_playlist, psz_value,
playlist_Add( p_playlist, psz_value, NULL, 0,
PLAYLIST_INSERT | PLAYLIST_GO,
p_playlist->i_index + 1 );
vlc_object_release( p_playlist );
......
......@@ -2,7 +2,7 @@
* slp.c: SLP access plugin
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: slp.c,v 1.12 2003/06/17 16:09:16 gbazin Exp $
* $Id: slp.c,v 1.13 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Loc Minier <lool@videolan.org>
*
......@@ -184,6 +184,8 @@ static SLPBoolean SrvUrlCallback( SLPHandle slph_slp,
p_playlist_item->i_type = 0;
p_playlist_item->i_status = 0;
p_playlist_item->b_autodeletion = VLC_FALSE;
p_playlist_item->i_options = 0;
p_playlist_item->ppsz_options = 0;
/* search the description of the stream */
if( SLPOpen( config_GetPsz( p_input, "slp-lang" ),
......
......@@ -2,7 +2,7 @@
* corba.c : CORBA (ORBit) remote control plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: corba.c,v 1.1 2003/07/07 16:59:00 sam Exp $
* $Id: corba.c,v 1.2 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Olivier Aubert <oaubert at lisi dot univ-lyon1 dot fr>
*
......@@ -560,7 +560,7 @@ impl_VLC_MediaControl_add_to_playlist(impl_POA_VLC_MediaControl * servant,
return;
}
playlist_Add (p_playlist, psz_file, PLAYLIST_REPLACE, 0);
playlist_Add (p_playlist, psz_file, 0, 0, PLAYLIST_REPLACE, 0);
vlc_object_release( p_playlist );
return;
......
......@@ -2,7 +2,7 @@
* http.c : http mini-server ;)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: http.c,v 1.16 2003/07/21 23:53:55 fenrir Exp $
* $Id: http.c,v 1.17 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -1399,7 +1399,7 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
char mrl[512];
uri_extract_value( p_request, "mrl", mrl, 512 );
uri_decode_url_encoded( mrl );
playlist_Add( p_sys->p_playlist, mrl,
playlist_Add( p_sys->p_playlist, mrl, NULL, 0,
PLAYLIST_APPEND, PLAYLIST_END );
msg_Dbg( p_intf, "requested playlist add: %s", mrl );
break;
......
......@@ -2,7 +2,7 @@
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: rc.c,v 1.35 2003/07/01 12:56:47 sam Exp $
* $Id: rc.c,v 1.36 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
......@@ -675,7 +675,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
else if( !strcmp( psz_cmd, "add" ) )
{
printf( "trying to add %s to playlist\n", newval.psz_string );
playlist_Add( p_playlist, newval.psz_string,
playlist_Add( p_playlist, newval.psz_string, NULL, 0,
PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
}
else if( !strcmp( psz_cmd, "playlist" ) )
......
......@@ -2,7 +2,7 @@
* m3u.c: a meta demux to parse pls, m3u, asx et b4s playlists
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: m3u.c,v 1.22 2003/06/29 19:15:04 fenrir Exp $
* $Id: m3u.c,v 1.23 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -552,9 +552,8 @@ static void ProcessLine ( input_thread_t *p_input, playlist_t *p_playlist,
if( b_next && *ppsz_uri )
{
playlist_AddName( p_playlist,
*ppsz_name ? *ppsz_name : *ppsz_uri,
*ppsz_uri,
PLAYLIST_INSERT, *pi_position );
*ppsz_name ? *ppsz_name : *ppsz_uri, *ppsz_uri,
0, 0, PLAYLIST_INSERT, *pi_position );
(*pi_position)++;
if( *ppsz_name )
{
......@@ -645,7 +644,8 @@ static int Demux ( input_thread_t *p_input )
psz_line[i_linepos] = '\0';
i_linepos = 0;
ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name, &i_position );
ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name,
&i_position );
}
input_DeletePacket( p_input->p_method_data, p_data );
......@@ -655,11 +655,13 @@ static int Demux ( input_thread_t *p_input )
{
psz_line[i_linepos] = '\0';
ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name, &i_position );
ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name,
&i_position );
/* is there a pendding uri without b_next */
if( psz_uri )
{
playlist_Add( p_playlist, psz_uri, PLAYLIST_INSERT, i_position );
playlist_Add( p_playlist, psz_uri, 0, 0,
PLAYLIST_INSERT, i_position );
}
}
......
......@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.33 2003/05/24 02:48:55 hartman Exp $
* $Id: mp4.c,v 1.34 2003/07/23 01:13:47 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -257,7 +257,8 @@ static int MP4Init( vlc_object_t * p_this )
!strncmp( psz_ref, "rtsp://", 7 ) )
{
msg_Dbg( p_input, "adding ref = `%s'", psz_ref );
playlist_Add( p_playlist, psz_ref, PLAYLIST_APPEND, PLAYLIST_END );
playlist_Add( p_playlist, psz_ref, 0, 0,
PLAYLIST_APPEND, PLAYLIST_END );
}
else
{
......@@ -278,7 +279,8 @@ static int MP4Init( vlc_object_t * p_this )
}
strcat( psz_absolute, psz_ref );
msg_Dbg( p_input, "adding ref = `%s'", psz_absolute );
playlist_Add( p_playlist, psz_absolute, PLAYLIST_APPEND, PLAYLIST_END );
playlist_Add( p_playlist, psz_absolute, 0, 0,
PLAYLIST_APPEND, PLAYLIST_END );
}
}
else
......
......@@ -2,7 +2,7 @@
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.cpp,v 1.35 2003/06/22 00:40:18 titer Exp $
* $Id: VlcWrapper.cpp,v 1.36 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -358,7 +358,7 @@ void VlcWrapper::OpenFiles( BList* o_files, bool replace, int32 index )
if ( BString* o_file = (BString *)o_files->RemoveItem( i ) )
{
playlist_Add( p_playlist, o_file->String(),
mode, index );
0, 0, mode, index );
if ( mode == PLAYLIST_INSERT )
index++;
delete o_file;
......@@ -381,7 +381,7 @@ void VlcWrapper::OpenDisc(BString o_type, BString o_device, int i_title, int i_c
o_device.Prepend( "dvdplay:" );
else
o_device.Prepend( "dvdold:" );
playlist_Add( p_playlist, o_device.String(),
playlist_Add( p_playlist, o_device.String(), 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
......
......@@ -2,7 +2,7 @@
* callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: callbacks.c,v 1.22 2003/03/13 15:50:17 marcari Exp $
* $Id: callbacks.c,v 1.23 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -105,7 +105,7 @@ void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
{
if (p_intf->p_sys->b_autoplayfile)
{
playlist_Add( p_playlist, (char*)psz_url,
playlist_Add( p_playlist, (char*)psz_url, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
else
......
......@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: open.c,v 1.14 2003/05/05 16:09:39 gbazin Exp $
* $Id: open.c,v 1.15 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -550,7 +550,7 @@ void GtkOpenOk( GtkButton * button, gpointer user_data )
psz_target = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "entry_open" ) ) );
playlist_Add( p_playlist, (char*)psz_target,
playlist_Add( p_playlist, (char*)psz_target, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* catch the GTK CList */
......
......@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: playlist.c,v 1.3 2003/01/23 15:52:04 sam Exp $
* $Id: playlist.c,v 1.4 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -622,7 +622,7 @@ int GtkAppendList( playlist_t * p_playlist, int i_pos, GList * p_list )
/* ok; this is a really nasty trick to insert
the item where they are suppose to go but, hey
this works :P (btw, you are really nasty too) */
g_list_nth_data( p_list, i_dummy ),
g_list_nth_data( p_list, i_dummy ), 0, 0,
i_dummy == 0 ? PLAYLIST_INSERT | PLAYLIST_GO : PLAYLIST_INSERT,
i_pos == PLAYLIST_END ? PLAYLIST_END : ( i_pos + i_dummy ) );
}
......
......@@ -208,7 +208,7 @@ void KInterface::slotFileOpen()
if( p_playlist )
{
fileOpenRecent->addURL( url );
playlist_Add( p_playlist, url.path(),
playlist_Add( p_playlist, url.path(), 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
vlc_object_release( p_playlist );
}
......@@ -536,7 +536,7 @@ void KInterface::slotOpenDisk()
if( p_playlist )
{
// add it to playlist
playlist_Add( p_playlist, source.latin1(),
playlist_Add( p_playlist, source.latin1(), 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
vlc_object_release( p_playlist );
}
......@@ -562,7 +562,7 @@ void KInterface::slotOpenStream()
if( p_playlist )
{
// add it to playlist
playlist_Add( p_playlist, source.latin1(),
playlist_Add( p_playlist, source.latin1(), 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
vlc_object_release( p_playlist );
}
......@@ -664,7 +664,7 @@ void KInterface::dropEvent( QDropEvent *event )
if( !(*i).isEmpty() )
{
fileOpenRecent->addURL( *i );
playlist_Add( p_playlist, (*i).path(),
playlist_Add( p_playlist, (*i).path(), 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
}
......
......@@ -2,7 +2,7 @@
* applescript.m: MacOS X AppleScript support
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: applescript.m,v 1.3 2003/06/15 15:20:21 hartman Exp $
* $Id: applescript.m,v 1.4 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......@@ -56,7 +56,7 @@
int i_mode = PLAYLIST_INSERT | PLAYLIST_GO;
playlist_Add( p_playlist, [o_urlString fileSystemRepresentation],
i_mode, PLAYLIST_END );
0, 0, i_mode, PLAYLIST_END );
o_url = [NSURL fileURLWithPath: o_urlString];
if( o_url != nil )
......@@ -143,4 +143,4 @@
return nil;
}
@end
\ No newline at end of file
@end
......@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.27 2003/06/30 01:51:10 hartman Exp $
* $Id: playlist.m,v 1.28 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
......@@ -312,7 +312,7 @@ int MacVersion102 = -1;
i_mode |= PLAYLIST_GO;
playlist_Add( p_playlist, [o_value fileSystemRepresentation],
i_mode, i_pos == -1 ? PLAYLIST_END : i_pos + i_items );
0, 0, i_mode, i_pos == -1 ? PLAYLIST_END : i_pos + i_items );
o_url = [NSURL fileURLWithPath: o_value];
if( o_url != nil )
......
......@@ -2,7 +2,7 @@
* intf.cpp: Qt interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf.cpp,v 1.3 2002/09/30 11:05:39 sam Exp $
* $Id: intf.cpp,v 1.4 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -299,7 +299,7 @@ void IntfWindow::FileOpen( void )
return;
}
playlist_Add( p_playlist, file.latin1(),
playlist_Add( p_playlist, file.latin1(), 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
vlc_object_release( p_playlist );
}
......
......@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.42 2003/07/20 20:42:23 ipkiss Exp $
* $Id: vlcproc.cpp,v 1.43 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -414,12 +414,12 @@ void VlcProc::DropFile( unsigned int param )
{
if( config_GetInt( p_intf, "enqueue" ) )
{
playlist_Add( p_intf->p_sys->p_playlist, FileName,
playlist_Add( p_intf->p_sys->p_playlist, FileName, 0, 0,
PLAYLIST_APPEND, PLAYLIST_END );
}
else
{
playlist_Add( p_intf->p_sys->p_playlist, FileName,
playlist_Add( p_intf->p_sys->p_playlist, FileName, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
}
......
......@@ -2,7 +2,7 @@
* dialogs.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: dialogs.cpp,v 1.4 2003/07/20 10:38:49 gbazin Exp $
* $Id: dialogs.cpp,v 1.5 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -277,11 +277,12 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event )
for( size_t i = 0; i < paths.GetCount(); i++ )
if( event.GetInt() )
playlist_Add( p_playlist, (const char *)paths[i].mb_str(),
0, 0,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO),
PLAYLIST_END );
else
playlist_Add( p_playlist, (const char *)paths[i].mb_str(),
PLAYLIST_APPEND, PLAYLIST_END );
0, 0, PLAYLIST_APPEND, PLAYLIST_END );
}
vlc_object_release( p_playlist );
......
......@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.52 2003/07/22 15:59:06 gbazin Exp $
* $Id: interface.cpp,v 1.53 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -833,7 +833,7 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
}
for( size_t i = 0; i < filenames.GetCount(); i++ )
playlist_Add( p_playlist, (const char *)filenames[i].mb_str(),
playlist_Add( p_playlist, (const char *)filenames[i].mb_str(), 0, 0,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END );
vlc_object_release( p_playlist );
......
......@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.28 2003/07/17 17:30:40 gbazin Exp $
* $Id: open.cpp,v 1.29 2003/07/23 01:13:47 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -660,7 +660,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
for( size_t i = 0; i < mrl.GetCount(); i++ )
{
playlist_Add( p_playlist, (const char *)mrl[i].mb_str(),
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END );
0, 0,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END );
}
//TogglePlayButton( PLAYING_S );
......
......@@ -2,7 +2,7 @@
* sap.c : SAP interface module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.18 2003/07/05 15:00:28 zorglub Exp $
* $Id: sap.c,v 1.19 2003/07/23 01:13:48 gbazin Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
......@@ -413,7 +413,7 @@ static int sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
p_playlist = vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
playlist_AddItem ( p_playlist, p_item,
playlist_AddItem ( p_playlist, p_item, 0, 0,
PLAYLIST_CHECK_INSERT, PLAYLIST_END);
vlc_object_release( p_playlist );
}
......
......@@ -2,7 +2,7 @@
* vlcpeer.cpp: scriptable peer descriptor
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcpeer.cpp,v 1.5 2003/07/16 16:33:59 sam Exp $
* $Id: vlcpeer.cpp,v 1.6 2003/07/23 01:13:48 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -71,7 +71,7 @@ NS_IMETHODIMP VlcPeer::Play()
{
if( !p_plugin->b_stream && p_plugin->psz_target )
{
VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target,
VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
p_plugin->b_stream = 1;
}
......
......@@ -2,7 +2,7 @@
* vlcshell.cpp: a VLC plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcshell.cpp,v 1.14 2003/07/16 16:33:59 sam Exp $
* $Id: vlcshell.cpp,v 1.15 2003/07/23 01:13:48 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -479,7 +479,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
{
#if USE_LIBVLC
VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target,
i_mode, PLAYLIST_END );
0, 0, i_mode, PLAYLIST_END );
#endif
p_plugin->b_stream = VLC_TRUE;
}
......@@ -579,7 +579,7 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
#if USE_LIBVLC
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
VLC_AddTarget( p_plugin->i_vlc, fname,
VLC_AddTarget( p_plugin->i_vlc, fname, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
#endif
}
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.233 2003/06/28 21:27:35 fenrir Exp $
* $Id: input.c,v 1.234 2003/07/23 01:13:48 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -56,6 +56,9 @@ static int InitThread ( input_thread_t *p_input );
static void ErrorThread ( input_thread_t *p_input );
static void EndThread ( input_thread_t *p_input );
static void ParseOption ( input_thread_t *p_input,
const char *psz_option );
/*****************************************************************************
* input_CreateThread: creates a new input thread
*****************************************************************************
......@@ -67,6 +70,7 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
{
input_thread_t * p_input; /* thread descriptor */
input_info_category_t * p_info;
int i;
/* Allocate descriptor */
p_input = vlc_object_create( p_parent, VLC_OBJECT_INPUT );
......@@ -76,6 +80,29 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
return NULL;
}
/* Parse input options */
for( i = 0; i < p_item->i_options; i++ )
{
ParseOption( p_input, p_item->ppsz_options[i] );
}
/* Create a few object variables we'll need later */
if( !var_Type( p_input, "sout" ) )
{
var_Create( p_input, "sout", VLC_VAR_STRING );
var_Change( p_input, "sout", VLC_VAR_INHERITVALUE, NULL, NULL );
}
if( !var_Type( p_input, "sout-audio" ) )
{
var_Create( p_input, "sout-audio", VLC_VAR_BOOL );
var_Change( p_input, "sout-audio", VLC_VAR_INHERITVALUE, NULL, NULL );
}
if( !var_Type( p_input, "sout-video" ) )
{
var_Create( p_input, "sout-video", VLC_VAR_BOOL );
var_Change( p_input, "sout-video", VLC_VAR_INHERITVALUE, NULL, NULL );
}
/* Initialize thread properties */
p_input->b_eof = 0;
......@@ -371,6 +398,7 @@ static int InitThread( input_thread_t * p_input )
{
/* Parse source string. Syntax : [[<access>][/<demux>]:][<source>] */
char * psz_parser = p_input->psz_dupsource = strdup(p_input->psz_source);
vlc_value_t val;
/* Skip the plug-in names */
while( *psz_parser && *psz_parser != ':' )
......@@ -518,21 +546,20 @@ static int InitThread( input_thread_t * p_input )
}
/* Initialize optional stream output. */
psz_parser = config_GetPsz( p_input, "sout" );
if ( psz_parser != NULL )
var_Get( p_input, "sout", &val );
if ( val.psz_string != NULL )
{
if ( *psz_parser &&
(p_input->stream.p_sout = sout_NewInstance( p_input, psz_parser ))
== NULL )
if ( *val.psz_string && (p_input->stream.p_sout =
sout_NewInstance( p_input, val.psz_string )) == NULL )
{
msg_Err( p_input, "cannot start stream output instance, aborting" );
free( psz_parser );
free( val.psz_string );
module_Unneed( p_input, p_input->p_access );