[FFmpeg-devel] [PATCH] movie video source

Stefano Sabatini stefano.sabatini-lala
Tue Jan 4 23:48:24 CET 2011

On date Tuesday 2011-01-04 18:48:48 +0100, Nicolas George encoded:
> Le quintidi 15 niv?se, an CCXIX, Stefano Sabatini a ?crit?:
> > What do you suggest to do, to make the cmdutils.c PtsCorrectionContext
> > API public and use it (av_pts_correction_init(),
> > av_pts_correction_guess()) or to duplicate the code?
> Something like that was evoked three weeks ago in the thread about the API
> example for lavfi. Since then, I thought I might try to implement it.
> My idea was to add the PtsCorrectionContext structure to the end of
> AVCodecContext and add some sort of avcodec_set_stream_time_base function:
> this way, avcodec_decode_video2 would be able to use the pts and dts fields
> in AVPacket directly without depending on libavformat.

My idea was to implement a dumb transposition of the correct_pts API
in cmdutils.c:

void av_pts_correction_init(AVPTSCorrectionContext *ctx);
int64_t av_pts_correction_guess(AVPTSCorrectionContext *ctx, int64_t pts, int64_t dts);

this would be defined in libavcodec/avcodec.h (as I don't see any
dependency on libavformat). I don't know if is a good idea to add the
AVPTSCorrectionContext to AVCodecContext, I suppose the idea would be
to move all the TS reordering code in ffplay.c to
avcodec_decode_video2() (and add another parameter decoder_reorder_pts
to AVCodecContext), anyway I'm not the best person to judge if this is
FFmpeg = Free Fierce Marvellous Portentous Ephemeral Gadget

More information about the ffmpeg-devel mailing list