Changeset ca86dc6059876337bd75bb2548461e7f5cdbfbd6

Show
Ignore:
Timestamp:
06/29/03 21:15:04 (5 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1056914104 +0000
git-parent:

[86ed538b360ef509f35d4006f5a810548ee6b439]

git-author:
Laurent Aimar <fenrir@videolan.org> 1056914104 +0000
Message:
  • m3u: remove useless debug messages, fix element insertion.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/m3u.c

    r7f81995 rca86dc6  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: m3u.c,v 1.21 2003/06/28 19:19:55 fenrir Exp $ 
     5 * $Id: m3u.c,v 1.22 2003/06/29 19:15:04 fenrir Exp $ 
    66 * 
    77 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> 
     
    376376        if( strstr ( psz_bol, "<Name>" ) ) 
    377377        { 
    378             msg_Dbg( p_input, "###########<Name>"); 
    379378            /* We have a name */ 
    380379            while ( *psz_bol && 
     
    402401        else if( strstr( psz_bol, "</entry>" ) || strstr( psz_bol, "</Entry>" )) 
    403402        { 
    404             msg_Dbg( p_input, "###########<Entry>"); 
    405403            *pb_next = VLC_TRUE; 
    406404            return 0; 
     
    438436    if ( !*psz_bol ) return 0; 
    439437 
    440     msg_Dbg( p_input, "############Line=%s", psz_bol ); 
    441438    /* 
    442439     * From now on, we know we've got a meaningful line 
     
    526523static void ProcessLine ( input_thread_t *p_input, playlist_t *p_playlist, 
    527524                          char *psz_line, 
    528                           char **ppsz_uri, char **ppsz_name ) 
     525                          char **ppsz_uri, char **ppsz_name, 
     526                          int *pi_position ) 
    529527{ 
    530528    char          psz_data[MAX_LINE]; 
    531529    vlc_bool_t    b_next; 
    532  
    533     msg_Dbg( p_input, "ProcessLine(0): name=%s uri=%s ", *ppsz_name, *ppsz_uri ); 
    534530 
    535531    switch( ParseLine( p_input, psz_line, psz_data, &b_next ) ) 
     
    553549            break; 
    554550    } 
    555     msg_Dbg( p_input, "name=%s uri=%s next=%d", *ppsz_name, *ppsz_uri, b_next ); 
     551 
    556552    if( b_next && *ppsz_uri ) 
    557553    { 
     
    559555                          *ppsz_name ? *ppsz_name : *ppsz_uri, 
    560556                          *ppsz_uri, 
    561                           PLAYLIST_INSERT, PLAYLIST_END ); 
     557                          PLAYLIST_INSERT, *pi_position ); 
     558        (*pi_position)++; 
    562559        if( *ppsz_name ) 
    563560        { 
     
    568565        *ppsz_uri  = NULL; 
    569566    } 
    570     msg_Dbg( p_input, "ProcessLine(1:: name=%s uri=%s ", *ppsz_name, *ppsz_uri ); 
    571567} 
    572568 
     
    591587    char          *psz_uri  = NULL; 
    592588 
     589    int           i_position; 
     590 
    593591    p_playlist = (playlist_t *) vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, 
    594592                                                 FIND_ANYWHERE ); 
     
    600598 
    601599    p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE; 
     600    i_position = p_playlist->i_index + 1; 
    602601 
    603602    /* Depending on wether we are dealing with an m3u/asf file, the end of 
     
    647646            i_linepos = 0; 
    648647 
    649             ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name ); 
     648            ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name, &i_position ); 
    650649        } 
    651650 
     
    657656        psz_line[i_linepos] = '\0'; 
    658657 
    659         ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name ); 
     658        ProcessLine( p_input, p_playlist, psz_line, &psz_uri, &psz_name, &i_position ); 
    660659        /* is there a pendding uri without b_next */ 
    661660        if( psz_uri ) 
    662661        { 
    663             playlist_Add( p_playlist, psz_uri, PLAYLIST_INSERT, PLAYLIST_END ); 
     662            playlist_Add( p_playlist, psz_uri, PLAYLIST_INSERT, i_position ); 
    664663        } 
    665664    }