Changeset 2f322e1f19b0ea622f5970f80d69eaa67bbcb836

Show
Ignore:
Timestamp:
10/05/05 12:38:35 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1115721515 +0000
git-parent:

[d32d1ee048f47f34457f1c8529915569d7c7c07a]

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

* modules/codec/ffmpeg/*, modules/stream_out/switcher.c: fix compilation with new ffmpeg versions (use native timebase).

Files:

Legend:

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

    r004f8aa r2f322e1  
    329329        p_context->height = p_enc->fmt_in.video.i_height; 
    330330 
     331#if LIBAVCODEC_BUILD >= 4754 
     332        p_context->time_base.num = p_enc->fmt_in.video.i_frame_rate_base; 
     333        p_context->time_base.den = p_enc->fmt_in.video.i_frame_rate; 
     334#else 
    331335        p_context->frame_rate = p_enc->fmt_in.video.i_frame_rate; 
    332336        p_context->frame_rate_base= p_enc->fmt_in.video.i_frame_rate_base; 
     337#endif 
    333338 
    334339        /* Defaults from ffmpeg.c */ 
  • modules/codec/ffmpeg/video.c

    ra234cf4 r2f322e1  
    187187    } 
    188188 
     189#if LIBAVCODEC_BUILD >= 4754 
     190    if( p_context->time_base.num > 0 && p_context->time_base.den > 0 ) 
     191    { 
     192        p_dec->fmt_out.video.i_frame_rate = p_context->time_base.den; 
     193        p_dec->fmt_out.video.i_frame_rate_base = p_context->time_base.num; 
     194    } 
     195#else 
    189196    if( p_context->frame_rate > 0 && p_context->frame_rate_base > 0 ) 
    190197    { 
     
    192199        p_dec->fmt_out.video.i_frame_rate_base = p_context->frame_rate_base; 
    193200    } 
     201#endif 
    194202 
    195203    p_pic = p_dec->pf_vout_buffer_new( p_dec ); 
     
    655663 
    656664            /* interpolate the next PTS */ 
     665#if LIBAVCODEC_BUILD >= 4754 
     666            if( p_sys->p_context->time_base.den > 0 ) 
     667            { 
     668                p_sys->i_pts += I64C(1000000) * 
     669                    (2 + p_sys->p_ff_pic->repeat_pict) * 
     670                    p_sys->p_context->time_base.num * 
     671                    p_block->i_rate / INPUT_RATE_DEFAULT / 
     672                    (2 * p_sys->p_context->time_base.den); 
     673            } 
     674#else 
    657675            if( p_sys->p_context->frame_rate > 0 ) 
    658676            { 
     
    663681                    (2 * p_sys->p_context->frame_rate); 
    664682            } 
     683#endif 
    665684 
    666685            if( p_sys->b_first_frame ) 
  • modules/stream_out/switcher.c

    r23f9442 r2f322e1  
    741741                   i_aspect_den * (int64_t)id->ff_enc_c->width, 1 << 30 ); 
    742742 
     743#if LIBAVCODEC_BUILD >= 4754 
     744        id->ff_enc_c->time_base.num = 1; 
     745        id->ff_enc_c->time_base.den = 25; /* FIXME */ 
     746#else 
    743747        id->ff_enc_c->frame_rate    = 25; /* FIXME */ 
    744748        id->ff_enc_c->frame_rate_base = 1; 
     749#endif 
    745750 
    746751        id->ff_enc_c->gop_size = 200;