Changeset 496d33dc3e1c4be6407291c55ee5abebab4c79b7

Show
Ignore:
Timestamp:
20/12/07 00:59:06 (1 year ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1198108746 +0000
git-parent:

[f4d1285582586efdc39d8c87753dc577f703389b]

git-author:
Rafaël Carré <funman@videolan.org> 1198108746 +0000
Message:

playlist demuxers: return -1 in case of error, 0 in case of eof, 1 else; like any correct demuxer. (we always return eof since playlists don't need 2 successive demuxing).
fix a corner case bug in ifo.c

Files:

Legend:

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

    r3f07af6 r496d33d  
    252252            p_sys->psz_data = realloc( p_sys->psz_data, p_sys->i_data_len * sizeof( char * ) +1 ); 
    253253        } 
    254         if( p_sys->i_data_len <= 0 ) return VLC_EGENERIC
     254        if( p_sys->i_data_len <= 0 ) return -1
    255255    } 
    256256 
     
    689689    } 
    690690    HANDLE_PLAY_AND_RELEASE; 
    691     return -1; /* Needed for correct operation of go back */ 
     691    return 0; /* Needed for correct operation of go back */ 
    692692} 
    693693 
  • modules/demux/playlist/b4s.c

    r6ee1e19 r496d33d  
    288288 
    289289    HANDLE_PLAY_AND_RELEASE; 
    290     return -1; /* Needed for correct operation of go back */ 
     290    return 0; /* Needed for correct operation of go back */ 
    291291} 
    292292 
  • modules/demux/playlist/dvb.c

    rc00cfde r496d33d  
    128128 
    129129    HANDLE_PLAY_AND_RELEASE; 
    130     return -1; /* Needed for correct operation of go back */ 
     130    return 0; /* Needed for correct operation of go back */ 
    131131} 
    132132 
  • modules/demux/playlist/gvp.c

    r3f07af6 r496d33d  
    223223    p_sys->p_playlist = NULL; 
    224224 
    225     return -1; /* Needed for correct operation of go back */ 
     225    return 0; /* Needed for correct operation of go back */ 
    226226} 
    227227 
  • modules/demux/playlist/ifo.c

    r3f07af6 r496d33d  
    5858        i_peek = stream_Peek( p_demux->s, &p_peek, 8 ); 
    5959 
    60         if( strncmp( p_peek, "DVDVIDEO", 8 ) ) 
     60        if( i_peek != 8 || memcmp( p_peek, "DVDVIDEO", 8 ) ) 
    6161            return VLC_EGENERIC; 
    6262    } 
     
    9696    HANDLE_PLAY_AND_RELEASE; 
    9797 
    98     return -1; /* Needed for correct operation of go back */ 
     98    return 0; /* Needed for correct operation of go back */ 
    9999} 
    100100 
  • modules/demux/playlist/itml.c

    rc39b64d r496d33d  
    121121    if( p_xml ) 
    122122        xml_Delete( p_xml ); 
    123     return -1; /* Needed for correct operation of go back */ 
     123    return 0; /* Needed for correct operation of go back */ 
    124124} 
    125125 
  • modules/demux/playlist/m3u.c

    r18eea45 r496d33d  
    220220    } 
    221221    HANDLE_PLAY_AND_RELEASE; 
    222     return -1; /* Needed for correct operation of go back */ 
     222    return 0; /* Needed for correct operation of go back */ 
    223223} 
    224224 
  • modules/demux/playlist/pls.c

    r3f07af6 r496d33d  
    236236 
    237237    HANDLE_PLAY_AND_RELEASE; 
    238     return -1; /* Needed for correct operation of go back */ 
     238    return 0; /* Needed for correct operation of go back */ 
    239239} 
    240240 
  • modules/demux/playlist/podcast.c

    r6ee1e19 r496d33d  
    321321 
    322322    HANDLE_PLAY_AND_RELEASE; 
    323     return -1; /* Needed for correct operation of go back */ 
     323    return 0; /* Needed for correct operation of go back */ 
    324324} 
    325325 
  • modules/demux/playlist/qtl.c

    r3429397 r496d33d  
    376376    free( psz_mimetype ); 
    377377 
    378     return -1; /* Needed for correct operation of go back */ 
     378    return 0; /* Needed for correct operation of go back */ 
    379379} 
    380380 
  • modules/demux/playlist/sgimb.c

    r3f07af6 r496d33d  
    378378    { 
    379379        msg_Err( p_demux, "A valid playlistitem could not be created" ); 
    380         return VLC_EGENERIC
     380        return -1
    381381    } 
    382382 
     
    407407    input_ItemAddSubItem( p_current_input, p_child ); 
    408408    HANDLE_PLAY_AND_RELEASE 
    409     return -1; /* Needed for correct operation of go back */ 
     409    return 0; /* Needed for correct operation of go back */ 
    410410} 
    411411 
  • modules/demux/playlist/shoutcast.c

    r3f07af6 r496d33d  
    148148    HANDLE_PLAY_AND_RELEASE; 
    149149    p_sys->p_playlist = NULL; 
    150     return -1; /* Needed for correct operation of go back */ 
     150    return 0; /* Needed for correct operation of go back */ 
    151151} 
    152152 
  • modules/demux/playlist/xspf.c

    rf4d1285 r496d33d  
    7171int Demux( demux_t *p_demux ) 
    7272{ 
    73     int i_ret = VLC_SUCCESS
     73    int i_ret = 1
    7474    xml_t *p_xml = NULL; 
    7575    xml_reader_t *p_xml_reader = NULL; 
     
    8484    p_xml = xml_Create( p_demux ); 
    8585    if( !p_xml ) 
    86         i_ret = VLC_ENOMOD
     86        i_ret = -1
    8787    else 
    8888    { 
    8989        p_xml_reader = xml_ReaderCreate( p_xml, p_demux->s ); 
    9090        if( !p_xml_reader ) 
    91             i_ret = VLC_EGENERIC
     91            i_ret = -1
    9292    } 
    9393 
    9494    /* locating the root node */ 
    95     if( i_ret == VLC_SUCCESS
     95    if( i_ret == 1
    9696    { 
    9797        do 
     
    100100            { 
    101101                msg_Err( p_demux, "can't read xml stream" ); 
    102                 i_ret = VLC_EGENERIC
     102                i_ret = -1
    103103            } 
    104104        } while( i_ret == VLC_SUCCESS && 
     
    106106    } 
    107107    /* checking root node name */ 
    108     if( i_ret == VLC_SUCCESS
     108    if( i_ret == 1
    109109    { 
    110110        psz_name = xml_ReaderName( p_xml_reader ); 
     
    112112        { 
    113113            msg_Err( p_demux, "invalid root node name: %s", psz_name ); 
    114             i_ret = VLC_EGENERIC
     114            i_ret = -1
    115115        } 
    116116        FREE_NAME(); 
    117117    } 
    118118 
    119     if( i_ret == VLC_SUCCESS
     119    if( i_ret == 1
    120120        i_ret = parse_playlist_node( p_demux, p_playlist, p_current_input, 
    121                                      p_xml_reader, "playlist" ) 
    122                                      ? VLC_SUCCESS : VLC_EGENERIC; 
     121                                     p_xml_reader, "playlist" ) ? 0 : -1; 
     122 
     123 
    123124    HANDLE_PLAY_AND_RELEASE; 
    124125    if( p_xml_reader )