Commit 3b6ac5b0 authored by Laurent Aimar's avatar Laurent Aimar

* all: input_CreateThread doesn't take a playlist_item_t anymore.

        export input_CreateThread/input_StopThread/input_DestroyThread.
parent f14ae4a2
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000, 2003 VideoLAN
* $Id: input_ext-intf.h,v 1.103 2004/01/26 20:48:09 fenrir Exp $
* $Id: input_ext-intf.h,v 1.104 2004/01/26 23:07:16 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -383,10 +383,10 @@ struct input_thread_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define input_CreateThread(a,b) __input_CreateThread(VLC_OBJECT(a),b)
input_thread_t * __input_CreateThread ( vlc_object_t *, playlist_item_t * );
void input_StopThread ( input_thread_t * );
void input_DestroyThread ( input_thread_t * );
#define input_CreateThread(a,b,c,d) __input_CreateThread(VLC_OBJECT(a),b,c,d)
VLC_EXPORT( input_thread_t *, __input_CreateThread, ( vlc_object_t *, char *psz_uri, char **ppsz_options, int i_options ) );
VLC_EXPORT( void, input_StopThread, ( input_thread_t * ) );
VLC_EXPORT( void, input_DestroyThread, ( input_thread_t * ) );
#define input_SetStatus(a,b) __input_SetStatus(VLC_OBJECT(a),b)
VLC_EXPORT( void, __input_SetStatus, ( vlc_object_t *, int ) );
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
* $Id: input.c,v 1.281 2004/01/26 22:42:50 hartman Exp $
* $Id: input.c,v 1.282 2004/01/26 23:07:16 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -81,12 +81,13 @@ static int RateCallback ( vlc_object_t *p_this, char const *psz_cmd,
* This function creates a new input, and returns a pointer
* to its description. On error, it returns NULL.
*****************************************************************************/
input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
playlist_item_t *p_item )
input_thread_t *__input_CreateThread( vlc_object_t *p_parent, char *psz_uri,
char **ppsz_options, int i_options )
{
input_thread_t * p_input; /* thread descriptor */
vlc_value_t val;
int i,j;
int i;
/* Allocate descriptor */
p_input = vlc_object_create( p_parent, VLC_OBJECT_INPUT );
......@@ -97,21 +98,10 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
}
/* Parse input options */
for( i = 0 ; i < p_item->i_categories ; i++ )
{
if( !strncmp( p_item->pp_categories[i]->psz_name, _("Options"), 7 ) )
{
msg_Dbg( p_input,"Parsing %i options for item",
p_item->pp_categories[i]->i_infos );
for( j = 0; j< p_item->pp_categories[i]->i_infos ; j++ )
for( i = 0; i < i_options; i++ )
{
msg_Dbg( p_input,"Option : %s",
p_item->pp_categories[i]->pp_infos[j]->psz_name);
ParseOption( p_input,
p_item->pp_categories[i]->pp_infos[j]->psz_value);
}
break;
}
msg_Dbg( p_input, "option: %s", ppsz_options[i] );
ParseOption( p_input, ppsz_options[i] );
}
/* Create a few object variables we'll need later on */
......@@ -181,7 +171,7 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
p_input->p_sys = NULL;
/* Set target */
p_input->psz_source = strdup( p_item->psz_uri );
p_input->psz_source = strdup( psz_uri );
/* Stream */
p_input->s = NULL;
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: playlist.c,v 1.76 2004/01/25 17:16:06 zorglub Exp $
* $Id: playlist.c,v 1.77 2004/01/26 23:07:16 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -566,6 +566,10 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
*****************************************************************************/
static void PlayItem( playlist_t *p_playlist )
{
playlist_item_t *p_item;
char **ppsz_options;
int i_options;
int i, j;
vlc_value_t val;
if( p_playlist->i_index == -1 )
{
......@@ -573,19 +577,47 @@ static void PlayItem( playlist_t *p_playlist )
{
return;
}
SkipItem( p_playlist, 1 );
}
if( p_playlist->i_enabled == 0)
{
return;
}
msg_Dbg( p_playlist, "creating new input thread" );
p_playlist->p_input = input_CreateThread( p_playlist,
p_playlist->pp_items[p_playlist->i_index] );
p_item = p_playlist->pp_items[p_playlist->i_index];
i_options = 0;
ppsz_options = NULL;
/* Beurk, who the hell have done that ???????, why moving options
* to playlist in a such *bad* way ? --fenrir_is_asking ...*/
/* Parse input options */
for( i = 0 ; i < p_item->i_categories ; i++ )
{
if( !strcmp( p_item->pp_categories[i]->psz_name, _("Options") ) )
{
msg_Dbg( p_playlist, "Parsing %i options for item", p_item->pp_categories[i]->i_infos );
for( j = 0; j< p_item->pp_categories[i]->i_infos ; j++ )
{
msg_Dbg( p_playlist, "Option : %s",
p_item->pp_categories[i]->pp_infos[j]->psz_name);
TAB_APPEND( i_options, ppsz_options,
p_item->pp_categories[i]->pp_infos[j]->psz_name );
}
break;
}
}
p_playlist->p_input = input_CreateThread( p_playlist, p_item->psz_uri,
ppsz_options, i_options );
if( ppsz_options )
{
free( ppsz_options );
}
val.i_int = p_playlist->i_index;
var_Set( p_playlist, "playlist-current", val);
}
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