Changeset 25c0339473ed27e7282f41e5a9a84e691b095a46

Show
Ignore:
Timestamp:
05/04/05 03:20:19 (4 years ago)
Author:
Derk-Jan Hartman <hartman@videolan.org>
git-committer:
Derk-Jan Hartman <hartman@videolan.org> 1112664019 +0000
git-parent:

[305818987ee24370c6619fe985228b3e1ff130b6]

git-author:
Derk-Jan Hartman <hartman@videolan.org> 1112664019 +0000
Message:

* rewind the stream to 0 if we found an id3 tag, but the flac demuxer ISNT the correct one. Same should be done for mp3 demuxer and any other demux that launches id3 module. But not today :D

Files:

Legend:

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

    rfeb3362 r25c0339  
    8787    if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) 
    8888    { 
    89         if( p_meta ) vlc_meta_Delete( p_meta ); 
    90         return VLC_EGENERIC; 
     89        goto error; 
    9190    } 
    9291 
     
    9594        if( strncmp( p_demux->psz_demux, "flac", 4 ) ) 
    9695        { 
    97             if( p_meta ) vlc_meta_Delete( p_meta ); 
    98             return VLC_EGENERIC; 
     96            goto error; 
    9997        } 
    10098        /* User forced */ 
     
    115113    { 
    116114        msg_Err( p_demux, "this isn't a STREAMINFO metadata block" ); 
    117         if( p_meta ) vlc_meta_Delete( p_meta ); 
    118         return VLC_EGENERIC; 
     115        goto error; 
    119116    } 
    120117 
     
    122119    { 
    123120        msg_Err( p_demux, "invalid size for a STREAMINFO metadata block" ); 
    124         if( p_meta ) vlc_meta_Delete( p_meta ); 
    125         return VLC_EGENERIC; 
     121        goto error; 
    126122    } 
    127123 
     
    155151    if( !p_sys->p_packetizer->p_module ) 
    156152    { 
     153        msg_Err( p_demux, "cannot find flac packetizer" ); 
     154        goto error; 
     155    } 
     156 
     157    p_sys->p_es = es_out_Add( p_demux->out, &fmt ); 
     158 
     159    return VLC_SUCCESS; 
     160 
     161error: 
     162    if( p_sys != NULL && p_sys->p_packetizer ) 
     163    { 
    157164        if( p_sys->p_packetizer->fmt_in.p_extra ) 
    158165            free( p_sys->p_packetizer->fmt_in.p_extra ); 
    159  
    160166        vlc_object_destroy( p_sys->p_packetizer ); 
    161         msg_Err( p_demux, "cannot find flac packetizer" ); 
    162         if( p_meta ) vlc_meta_Delete( p_meta ); 
    163         return VLC_EGENERIC; 
    164     } 
    165  
    166     p_sys->p_es = es_out_Add( p_demux->out, &fmt ); 
    167  
    168     return VLC_SUCCESS; 
     167    } 
     168    if( p_meta ) 
     169    { 
     170        int b_seekable; 
     171        vlc_meta_Delete( p_meta ); 
     172        stream_Control( p_demux->s, STREAM_CAN_FASTSEEK, &b_seekable ); 
     173        if( b_seekable ) stream_Seek( p_demux->s, 0 ); 
     174    } 
     175    return VLC_EGENERIC; 
    169176} 
    170177