Changeset b691d5d74ab962f1d9717cdfa2c576925d903116

Show
Ignore:
Timestamp:
21/11/07 19:02:04 (11 months ago)
Author:
Christophe Massiot <massiot@videolan.org>
git-committer:
Christophe Massiot <massiot@videolan.org> 1195668124 +0000
git-parent:

[d4bbae044e7958a24d21cc4b80bd663d61e6d9a3]

git-author:
Christophe Massiot <massiot@videolan.org> 1195668124 +0000
Message:
  • modules/codec/x264.c: Fixed DTS when adaptive B frames are used (still
    wrong for bpyramid, though).
Files:

Legend:

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

    r6ee1e19 rb691d5d  
    670670    uint8_t         *p_buffer; 
    671671 
    672     mtime_t         i_last_ref_pts; 
     672    mtime_t         i_interpolated_dts; 
    673673 
    674674    char *psz_stat_name; 
     
    721721    p_enc->pf_encode_audio = NULL; 
    722722    p_enc->p_sys = p_sys = malloc( sizeof( encoder_sys_t ) ); 
    723     p_sys->i_last_ref_pts = 0; 
     723    p_sys->i_interpolated_dts = 0; 
    724724    p_sys->psz_stat_name = NULL; 
    725725 
     
    12401240            p_enc->fmt_in.video.i_frame_rate; 
    12411241 
    1242     p_block->i_dts = p_block->i_pts = pic.i_pts; 
     1242    p_block->i_pts = pic.i_pts; 
    12431243 
    12441244    if( p_sys->param.i_bframe > 0 ) 
     
    12461246        if( p_block->i_flags & BLOCK_FLAG_TYPE_B ) 
    12471247        { 
     1248            /* FIXME : this is wrong if bpyramid is set */ 
    12481249            p_block->i_dts = p_block->i_pts; 
     1250            p_sys->i_interpolated_dts = p_block->i_dts; 
    12491251        } 
    12501252        else 
    12511253        { 
    1252             if( p_sys->i_last_ref_pts ) 
     1254            if( p_sys->i_interpolated_dts ) 
    12531255            { 
    1254                 p_block->i_dts = p_sys->i_last_ref_pts; 
     1256                p_block->i_dts = p_sys->i_interpolated_dts; 
    12551257            } 
    12561258            else 
     
    12601262            } 
    12611263 
    1262             p_sys->i_last_ref_pts = p_block->i_pts
     1264            p_sys->i_interpolated_dts += p_block->i_length
    12631265        } 
     1266    } 
     1267    else 
     1268    { 
     1269        p_block->i_dts = p_block->i_pts; 
    12641270    } 
    12651271