Commit 0984909d authored by Olivier Aubert's avatar Olivier Aubert

src/control/core.c: fix start-time handling in start + coding style fixes

parent 06ecc0b0
......@@ -195,16 +195,23 @@ mediacontrol_start( mediacontrol_Instance *self,
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
int i_from;
char * psz_from = (char *) malloc (20 * sizeof(char));
playlist_item_t * p_item = *(p_playlist->pp_items);
int i_index;
int i_from;
char * psz_from = ( char * )malloc( 20 * sizeof( char ) );
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_item, psz_from);
free(psz_from);
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 );
......
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