Commit e13b6c4d authored by Laurent Aimar's avatar Laurent Aimar

* all: added a "input-repeat" option that allow repeating the same entry

 without destroying/recreating a new input. (Will be usefull for streaming).
 ( A value of -1 means repeat for ever).
 --> Not tested with dvd.
parent e8f07ae1
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
* $Id: input.c,v 1.288 2004/02/08 17:21:50 fenrir Exp $
* $Id: input.c,v 1.289 2004/02/11 19:17:14 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -120,6 +120,9 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent, char *psz_uri,
var_Create( p_input, "sout-video", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_input, "sout-keep", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* repeat variable */
var_Create( p_input, "input-repeat", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
/* decoders */
var_Create( p_input, "minimize-threads", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
......@@ -465,12 +468,30 @@ static int RunThread( input_thread_t *p_input )
i_count = p_input->pf_demux( p_input );
if( i_count == 0 )
{
vlc_value_t repeat;
var_Get( p_input, "input-repeat", &repeat );
if( repeat.i_int == 0 || p_input->stream.i_area_nb <= 0 )
{
/* End of file - we do not set b_die because only the
* playlist is allowed to do so. */
msg_Info( p_input, "EOF reached" );
p_input->b_eof = 1;
}
else
{
msg_Dbg( p_input, "repeating the same input (%d)", repeat.i_int );
if( repeat.i_int > 0 )
{
repeat.i_int--;
var_Set( p_input, "input-repeat", repeat );
}
p_input->stream.p_new_area = p_input->stream.pp_areas[0];
p_input->stream.p_new_area->i_seek = 0;
}
}
else if( i_count < 0 )
{
p_input->b_error = 1;
......
......@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.132 2004/01/31 18:02:32 alexis Exp $
* $Id: libvlc.h,v 1.133 2004/02/11 19:17:13 fenrir Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -321,6 +321,9 @@ static char *ppsz_align_descriptions[] = { N_("Center"),
"Give the stream number of the subtitle channel you want to use " \
"(from 1 to n).")
#define INPUT_REPEAT_TEXT N_("Number of time the same input will be repeated")
#define INPUT_REPEAT_LONGTEXT N_("Number of time the same input will be repeated")
#define SUB_AUTO_TEXT N_("Autodetect subtitle files")
#define SUB_AUTO_LONGTEXT \
"Automatically detect a subtitle file, if no subtitle filename is " \
......@@ -772,7 +775,8 @@ vlc_module_begin();
SUB_FUZZY_TEXT, SUB_FUZZY_LONGTEXT, VLC_TRUE );
add_file( "sub-file", NULL, NULL,
SUB_FILE_TEXT, SUB_FILE_LONGTEXT, VLC_TRUE );
add_integer( "input-repeat", 0, NULL,
INPUT_REPEAT_TEXT, INPUT_REPEAT_LONGTEXT, VLC_TRUE );
add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, VLC_FALSE );
add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT, VLC_FALSE );
......
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