Commit 72dbf028 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

demux: playlist: simplify setting duration

The input item needs not be locked when it has not yet been exposed (to
any other thread), since there are no ways that any other thread could
acccess it yet.
parent 6b35f2b1
......@@ -294,8 +294,8 @@ static void ProcessEntry( int *pi_n_entry, xml_reader_t *p_xml_reader,
input_item_SetURL( p_entry, psz_moreinfo );
if( psz_description )
input_item_SetDescription( p_entry, psz_description );
if( i_duration > 0)
input_item_SetDuration( p_entry, i_duration );
if( i_duration > 0 )
p_entry->i_duration = i_duration;
input_item_node_AppendItem( p_subitems, p_entry );
......
......@@ -263,7 +263,7 @@ static int Demux( demux_t *p_demux )
/* Set the duration if available */
if( psz_item_duration )
input_item_SetDuration( p_input, strTimeToMTime( psz_item_duration ) );
p_input->i_duration = strTimeToMTime( psz_item_duration );
#define ADD_INFO( info, field ) \
if( field ) { \
......
......@@ -541,10 +541,7 @@ static bool set_item_info SIMPLE_INTERFACE
else if (!strcmp(psz_name, "trackNum"))
input_item_SetTrackNum(p_input, psz_value);
else if (!strcmp(psz_name, "duration"))
{
long i_num = atol(psz_value);
input_item_SetDuration(p_input, (mtime_t) i_num*1000);
}
p_input->i_duration = atol(psz_value) * INT64_C(1000);
else if (!strcmp(psz_name, "annotation"))
input_item_SetDescription(p_input, psz_value);
else if (!strcmp(psz_name, "info"))
......
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