Changeset 686e89e12858d03421426a82e8f25e371b640dce

Show
Ignore:
Timestamp:
18/10/07 21:36:06 (1 year ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1192736166 +0000
git-parent:

[93bdb6e35c484e18f48307daeb5964c3df362b5b]

git-author:
Laurent Aimar <fenrir@videolan.org> 1192736166 +0000
Message:

Fixed infinite loop.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/cc.c

    r6dc378e r686e89e  
    149149    int     i_block; 
    150150    block_t *pp_block[CC_MAX_REORDER_SIZE]; 
    151     block_t *p_current; 
    152151 
    153152    int i_field; 
     
    204203    memset( p_sys, 0, sizeof( *p_sys ) ); 
    205204    p_sys->i_block = 0; 
    206     p_sys->p_current = NULL; 
    207205 
    208206    p_sys->i_field = i_field; 
     
    235233    for( ;; ) 
    236234    { 
    237         block_t *p_block; 
    238  
    239         p_block = p_sys->p_current; 
    240         if( !p_block ) 
    241             p_block = Pop( p_dec ); 
     235        block_t *p_block = Pop( p_dec ); 
    242236        if( !p_block ) 
    243237            break; 
     
    386380    vlc_bool_t b_changed = VLC_FALSE; 
    387381 
    388     p_sys->p_current = p_block; 
    389  
    390382    /* TODO do the real decoding here */ 
    391     while( p_block && p_block->i_buffer >= 3 ) 
     383    while( p_block->i_buffer >= 3 ) 
    392384    { 
    393385        if( p_block->p_buffer[0] == p_sys->i_field ) 
     
    396388        p_block->i_buffer -= 3; 
    397389        p_block->p_buffer += 3; 
    398         if( p_block->i_buffer <= 0 ) 
    399         { 
    400             block_Release( p_block ); 
    401             p_sys->p_current = p_block = NULL; 
    402         } 
    403     } 
     390    } 
     391    if( p_block ) 
     392        block_Release( p_block ); 
     393 
    404394    static int64_t i_last = 0; 
    405395    if( b_changed )//&& i_pts - i_last > 100*1000 ) 
     
    10921082    if( h->i_channel != i_channel_selected ) 
    10931083        return VLC_FALSE; 
     1084    //fprintf( stderr, "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC %x %x\n", data[0], data[1] ); 
    10941085 
    10951086    if( d1 >= 0x10 )