[FFmpeg-devel] [PATCH] Pass pts values through encoder by default.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Jan 22 11:25:25 CET 2012
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;
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){
int ret = avctx->codec->encode(avctx, buf, buf_size, pict);
avctx->frame_number++;
--
1.7.8.3
More information about the ffmpeg-devel
mailing list