p_input->p->i_start = 0;
p_input->i_time = 0;
p_input->p->i_stop = 0;
+ p_input->p->i_run = 0;
p_input->p->i_title = 0;
p_input->p->title = NULL;
p_input->p->i_title_offset = p_input->p->i_seekpoint_offset = 0;
*psz_end = 0;
if( !strncmp( psz_start, "name=", 5 ) )
{
- p_seekpoint->psz_name = psz_start + 5;
+ p_seekpoint->psz_name = strdup(psz_start + 5);
}
else if( !strncmp( psz_start, "bytes=", 6 ) )
{
*****************************************************************************/
static void MainLoop( input_thread_t *p_input )
{
+ int64_t i_start_mdate = mdate();
int64_t i_intf_update = 0;
int i_updates = 0;
/* Do the read */
if( p_input->i_state != PAUSE_S )
{
- if( p_input->p->i_stop <= 0 || p_input->i_time < p_input->p->i_stop )
- i_ret=p_input->p->input.p_demux->pf_demux(p_input->p->input.p_demux);
+ if( ( p_input->p->i_stop > 0 && p_input->i_time >= p_input->p->i_stop ) ||
+ ( p_input->p->i_run > 0 && i_start_mdate+p_input->p->i_run < mdate() ) )
+ i_ret = 0; /* EOF */
else
- i_ret = 0; /* EOF */
+ i_ret = p_input->p->input.p_demux->pf_demux(p_input->p->input.p_demux);
if( i_ret > 0 )
{
input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION,
&val );
}
+
+ /* */
+ i_start_mdate = mdate();
}
}
else if( i_ret < 0 )
/* Start time*/
/* Set start time */
- p_input->p->i_start = (int64_t)var_GetInteger( p_input, "start-time" ) *
- I64C(1000000);
- p_input->p->i_stop = (int64_t)var_GetInteger( p_input, "stop-time" ) *
- I64C(1000000);
+ p_input->p->i_start = I64C(1000000) * var_GetInteger( p_input, "start-time" );
+ p_input->p->i_stop = I64C(1000000) * var_GetInteger( p_input, "stop-time" );
+ p_input->p->i_run = I64C(1000000) * var_GetInteger( p_input, "run-time" );
+ if( p_input->p->i_run < 0 )
+ {
+ msg_Warn( p_input, "invalid run-time ignored" );
+ p_input->p->i_run = 0;
+ }
if( p_input->p->i_start > 0 )
{
val.i_int = i_rate;
var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
- /* We will not send audio data if new rate != default */
- if( i_rate != INPUT_RATE_DEFAULT && p_input->p->i_rate == INPUT_RATE_DEFAULT )
- input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_TRUE );
+ input_EsOutDiscontinuity( p_input->p->p_es_out,
+ VLC_FALSE, VLC_FALSE );
p_input->p->i_rate = i_rate;
- /* Reset clock */
- es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
+ input_EsOutSetRate( p_input->p->p_es_out );
b_force_update = VLC_TRUE;
}
psz_access, psz_demux, psz_path,
p_input->b_preparsing );
}
-
+ /* access failed, maybe our access detection was wrong.
+ * Retry with the full name */
+ if( in->p_access == NULL && strchr( psz_mrl, ':' ) )
+ {
+ msg_Dbg( p_input, "retrying with access `' demux `' path `%s'",
+ psz_mrl );
+ in->p_access = access2_New( p_input,
+ "", "", psz_mrl,
+ p_input->b_preparsing );
+ }
if( in->p_access == NULL )
{
msg_Err( p_input, "open of `%s' failed: %s", psz_mrl,
{
input_item_t *p_item = p_input->p->input.p_item;
char *psz_title = NULL;
+ int i;
if( !p_meta )
return;
}
p_item->p_meta->i_status |= ITEM_PREPARSED;
+
+ /* A bit ugly */
+ p_meta = NULL;
+ if( vlc_dictionary_keys_count( &p_item->p_meta->extra_tags ) > 0 )
+ {
+ p_meta = vlc_meta_New();
+ vlc_meta_Merge( p_meta, p_item->p_meta );
+ }
vlc_mutex_unlock( &p_item->lock );
if( psz_title )
free( psz_title );
}
+ if( p_meta )
+ {
+ char ** ppsz_all_keys = vlc_dictionary_all_keys( &p_meta->extra_tags );
+ for( i = 0; ppsz_all_keys[i]; i++ )
+ {
+ input_Control( p_input, INPUT_ADD_INFO, _(VLC_META_INFO_CAT), _(ppsz_all_keys[i]),
+ vlc_dictionary_value_for_key( &p_meta->extra_tags, ppsz_all_keys[i] ) );
+ free( ppsz_all_keys[i] );
+ }
+ free( ppsz_all_keys );
+ vlc_meta_Delete( p_meta );
+ }
+
/** \todo handle sout meta */
}
static inline vlc_bool_t IsValidAccess( const char *psz )
{
- unsigned char c;
+ char c;
while( ( c = *psz ) != '\0' )
{
if( c == ':' )
return VLC_TRUE;
- if( !isascii( c ) || !isalnum( c ) || ( c != '/' ) )
+ if( ( !isascii( c ) || !isalnum( c ) ) && ( c != '/' ) )
return VLC_FALSE;
-
psz++;
}
- return VLC_FALSE; /* should not happen though */
+ /* should not happen though */
+ return VLC_FALSE;
}