Changeset a6b8118109995ae1b11f941af1b6f8290ed24f56

Show
Ignore:
Timestamp:
29/08/04 14:27:49 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1093782469 +0000
git-parent:

[381e1674700ab2f029bef8d18289a882ee894924]

git-author:
Gildas Bazin <gbazin@videolan.org> 1093782469 +0000
Message:

* modules/demux/ogg.c: fixed skipped pictures problem when starting a stream.

Files:

Legend:

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

    r535be4f ra6b8118  
    480480    vlc_bool_t b_selected; 
    481481    int i_header_len = 0; 
    482     mtime_t i_pts = 0
     482    mtime_t i_pts = -1, i_interpolated_pts
    483483 
    484484    /* Sanity check */ 
     
    509509    { 
    510510        uint8_t *p_extra; 
    511    vlc_bool_t b_store_size = VLC_TRUE; 
     511        vlc_bool_t b_store_size = VLC_TRUE; 
    512512 
    513513        p_stream->i_packets_backup++; 
     
    523523          if( p_stream->i_packets_backup == 2 ) 
    524524          { 
    525          Ogg_ReadFlacHeader( p_demux, p_stream, p_oggpacket ); 
     525              Ogg_ReadFlacHeader( p_demux, p_stream, p_oggpacket ); 
    526526              p_stream->b_force_backup = 0; 
    527527          } 
     
    553553            p_stream->fmt.p_extra = 
    554554                realloc( p_stream->fmt.p_extra, p_stream->i_headers ); 
    555        memcpy( p_stream->fmt.p_extra, p_stream->p_headers, 
    556            p_stream->i_headers ); 
     555            memcpy( p_stream->fmt.p_extra, p_stream->p_headers, 
     556                    p_stream->i_headers ); 
    557557            es_out_Control( p_demux->out, ES_OUT_SET_FMT, 
    558558                            p_stream->p_es, &p_stream->fmt ); 
     
    589589 
    590590    /* Convert the granulepos into the next pcr */ 
     591    i_interpolated_pts = p_stream->i_interpolated_pcr; 
    591592    Ogg_UpdatePCR( p_stream, p_oggpacket ); 
    592593 
     
    624625 
    625626    if( !( p_block = block_New( p_demux, p_oggpacket->bytes ) ) ) return; 
     627 
     628    /* Normalize PTS */ 
     629    if( i_pts == 0 ) i_pts = 1; 
     630    else if( i_pts == -1 && i_interpolated_pts == 0 ) i_pts = 1; 
     631    else if( i_pts == -1 ) i_pts = 0; 
    626632 
    627633    if( p_stream->fmt.i_cat == AUDIO_ES ) 
     
    12511257    { 
    12521258        if( bs_read( &s, 24 ) >= 34 /*size STREAMINFO*/ ) 
    1253    
    1254        bs_skip( &s, 80 ); 
    1255        p_stream->f_rate = p_stream->fmt.audio.i_rate = bs_read( &s, 20 ); 
    1256        p_stream->fmt.audio.i_channels = bs_read( &s, 3 ) + 1; 
    1257  
    1258        msg_Dbg( p_demux, "FLAC header, channels: %i, rate: %i", 
    1259             p_stream->fmt.audio.i_channels, (int)p_stream->f_rate ); 
    1260    
    1261    else msg_Dbg( p_demux, "FLAC STREAMINFO metadata too short" ); 
    1262  
    1263    /* Fake this as the last metadata block */ 
    1264    *((uint8_t*)p_oggpacket->packet) |= 0x80; 
     1259       
     1260            bs_skip( &s, 80 ); 
     1261            p_stream->f_rate = p_stream->fmt.audio.i_rate = bs_read( &s, 20 ); 
     1262            p_stream->fmt.audio.i_channels = bs_read( &s, 3 ) + 1; 
     1263 
     1264            msg_Dbg( p_demux, "FLAC header, channels: %i, rate: %i", 
     1265                     p_stream->fmt.audio.i_channels, (int)p_stream->f_rate ); 
     1266       
     1267        else msg_Dbg( p_demux, "FLAC STREAMINFO metadata too short" ); 
     1268 
     1269        /* Fake this as the last metadata block */ 
     1270        *((uint8_t*)p_oggpacket->packet) |= 0x80; 
    12651271    } 
    12661272    else