[FFmpeg-devel] [PATCH] Pass pts values through encoder by default.
Reimar.Doeffinger at gmx.de
Sun Jan 22 14:00:05 CET 2012
On Sun, Jan 22, 2012 at 01:53:12PM +0100, Michael Niedermayer wrote:
> On Sun, Jan 22, 2012 at 11:25:25AM +0100, Reimar Döffinger wrote:
> > Avoids having to duplicate the code for trivial, non-reordering
> > encoders.
> > Completely and utterly breaks almost all H.264 conformance tests,
> > sometimes just making the pts start with negative values, sometimes
> > only giving 2 instead of 20 decoded frames or failing with not
> > correctly ordered pts.
> > Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> > ---
> > libavcodec/utils.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > index a505fa5..ce6e93c 100644
> > --- a/libavcodec/utils.c
> > +++ b/libavcodec/utils.c
> > @@ -1141,6 +1141,8 @@ int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf
> > }
> > if(av_image_check_size(avctx->width, avctx->height, 0, avctx))
> > return -1;
> > + if (pict)
> > + avctx->coded_frame->pts = pict->pts;
> This doesnt look correct for non trivial encoders like h264
> but maybe iam not fully awake yet ...
The idea is to provide a default, so that all those small and trivial
encoders don't all have to add boiler-plate like that.
Any of the more complex encoders would have to set proper values.
Either way it does not matter for the FATE issues since for testing the
samples we only use a trivial raw encoder.
More information about the ffmpeg-devel