Changeset 0984909d714ed730b8399a5fb85cb72b7c6bea17

Show
Ignore:
Timestamp:
15/12/05 10:00:28 (3 years ago)
Author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr>
git-committer:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1134637228 +0000
git-parent:

[06ecc0b06606d780410b41770840c4eeb6032135]

git-author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1134637228 +0000
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/control/core.c

    r56439bf r0984909  
    196196    if( p_playlist->i_size ) 
    197197    { 
    198         int i_from;  
    199    char * psz_from = (char *) malloc (20 * sizeof(char))
    200     playlist_item_t * p_item = *(p_playlist->pp_items); 
     198        int i_index; 
     199        int i_from
     200    char * psz_from = ( char * )malloc( 20 * sizeof( char ) ); 
    201201 
    202202        i_from = mediacontrol_position2microsecond( p_playlist->p_input, a_position ) / 1000000; 
    203203     
     204        i_index = p_playlist->i_index; 
     205        if( i_index < 0 ) 
     206        {  
     207            /* We know that there is at least 1 element, since i_size != 0 */ 
     208            i_index = 0; 
     209        } 
     210 
    204211        /* Set start time */ 
    205     snprintf( psz_from, 20, "start-time=%i", i_from); 
    206     playlist_ItemAddOption( p_item, psz_from); 
    207     free(psz_from); 
     212    snprintf( psz_from, 20, "start-time=%i", i_from ); 
     213    playlist_ItemAddOption( p_playlist->pp_items[i_index], psz_from ); 
     214    free( psz_from ); 
    208215 
    209216        vlc_mutex_unlock( &p_playlist->object_lock );