Commit 1828267a authored by Olivier Aubert's avatar Olivier Aubert

src/control/mediacontrol_core.c: restore start position code, it works now.

parent 32a31f32
......@@ -188,7 +188,39 @@ mediacontrol_start( mediacontrol_Instance *self,
RAISE( mediacontrol_PlaylistException, "No available playlist" );
return;
}
playlist_Play( p_playlist );
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
int i_index;
int i_from;
char *psz_from = NULL;
psz_from = ( char * )malloc( 20 * sizeof( char ) );
if( psz_from )
{
i_from = mediacontrol_position2microsecond( p_playlist->p_input, a_position ) / 1000000;
i_index = p_playlist->i_index;
if( i_index < 0 )
{
/* We know that there is at least 1 element, since i_size != 0 */
i_index = 0;
}
/* Set start time */
snprintf( psz_from, 20, "start-time=%i", i_from );
playlist_ItemAddOption( p_playlist->pp_items[i_index], psz_from );
free( psz_from );
}
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
}
else
{
RAISE( mediacontrol_PlaylistException, "Empty playlist." );
vlc_mutex_unlock( &p_playlist->object_lock );
}
}
void
......
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