Changeset 06438cff3f2947f729362fe3bcea29551721a48c

Show
Ignore:
Timestamp:
06/04/05 11:31:38 (4 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1112779898 +0000
git-parent:

[53a27d3eb660248ff99e968aed7f9d6854aacbe0]

git-author:
Laurent Aimar <fenrir@videolan.org> 1112779898 +0000
Message:
  • h264: bug fix (give valid date + split at the right place).
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/packetizer/h264.c

    ra90a19a r06438cf  
    6868    block_t    *p_frame; 
    6969 
    70     int64_t      i_dts; 
    71     int64_t      i_pts; 
    72     unsigned int i_flags; 
    73  
    7470    vlc_bool_t   b_sps; 
    7571 
     
    104100    NAL_SEI         = 6,    /* ref_idc == 0 */ 
    105101    NAL_SPS         = 7, 
    106     NAL_PPS         = 8 
     102    NAL_PPS         = 8, 
     103    NAL_AU_DELIMITER= 9 
    107104    /* ref_idc == 0 for 6,9,10,11,12 */ 
    108105}; 
     
    153150    p_sys->b_slice = VLC_FALSE; 
    154151    p_sys->p_frame = NULL; 
    155     p_sys->i_dts   = 0; 
    156     p_sys->i_pts   = 0; 
    157     p_sys->i_flags = 0; 
    158152    p_sys->b_sps   = VLC_FALSE; 
    159153 
     
    295289                    break; 
    296290                } 
     291#if 0 
     292                msg_Dbg( p_dec, "pts="I64Fd" dts="I64Fd, 
     293                         p_pic->i_pts, p_pic->i_dts ); 
     294#endif 
    297295 
    298296                /* So p_block doesn't get re-added several times */ 
     
    419417    const int i_nal_ref_idc = (p_frag->p_buffer[3] >> 5)&0x03; 
    420418    const int i_nal_type = p_frag->p_buffer[3]&0x1f; 
     419 
     420#define OUTPUT \ 
     421    do {                                                \ 
     422        p_pic = block_ChainGather( p_sys->p_frame );    \ 
     423        p_pic->i_length = 0;    /* FIXME */             \ 
     424                                                        \ 
     425        p_sys->p_frame = NULL;                          \ 
     426        p_sys->b_slice = VLC_FALSE;                     \ 
     427    } while(0) 
     428 
    421429 
    422430    if( p_sys->b_slice && !p_sys->b_sps ) 
     
    508516 
    509517        if( b_pic && p_sys->b_slice ) 
    510         { 
    511             p_pic = block_ChainGather( p_sys->p_frame ); 
    512             p_pic->i_dts = p_sys->i_dts; 
    513             p_pic->i_pts = p_sys->i_pts; 
    514             p_pic->i_length = 0;    /* FIXME */ 
    515             p_pic->i_flags = p_sys->i_flags; 
    516  
    517             /* Reset context */ 
    518             p_sys->p_frame = NULL; 
    519             p_sys->b_slice = VLC_FALSE; 
    520         } 
     518            OUTPUT; 
    521519 
    522520        p_sys->b_slice = VLC_TRUE; 
    523         p_sys->i_flags = i_pic_flags; 
    524         p_sys->i_dts   = p_frag->i_dts; 
    525         p_sys->i_pts   = p_frag->i_pts; 
    526521 
    527522        free( dec ); 
     
    640635 
    641636        free( dec ); 
     637 
     638 
     639        if( p_sys->b_slice ) 
     640            OUTPUT; 
    642641    } 
    643642    else if( i_nal_type == NAL_PPS ) 
     
    648647        /* TODO */ 
    649648        msg_Dbg( p_dec, "found NAL_PPS" ); 
    650     } 
     649 
     650        if( p_sys->b_slice ) 
     651            OUTPUT; 
     652    } 
     653    else if( i_nal_type == NAL_AU_DELIMITER || 
     654             i_nal_type == NAL_SEI || 
     655             ( i_nal_type >= 13 && i_nal_type <= 18 ) ) 
     656    { 
     657        if( p_sys->b_slice ) 
     658            OUTPUT; 
     659    } 
     660 
     661#undef OUTPUT 
    651662 
    652663    /* Append the block */