[FFmpeg-devel] [PATCH] pkt_pts reordering (original) (raw)
Michael Niedermayer michaelni
Sat Jan 8 00:07:56 CET 2011
- Previous message: [FFmpeg-devel] [PATCH] pkt_pts reordering
- Next message: [FFmpeg-devel] [PATCH] pkt_pts reordering
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jan 07, 2011 at 10:16:14PM +0100, Stefano Sabatini wrote:
On date Friday 2011-01-07 15:37:01 +0100, Michael Niedermayer encoded: > There was some discussion about this, heres actual code > I will apply this later today if noone complains > Also after this patch it should become easier both to add multframe/thread > decoders as well as a single timestamp through guesscorrectpts() > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > The worst form of inequality is to try to make unequal things equal. > -- Aristotle
> From 67cbc7b3471beb99f325396f0ec5b5400d25644a Mon Sep 17 00:00:00 2001 > From: Michael Niedermayer > Date: Fri, 7 Jan 2011 15:06:39 +0100 > Subject: [PATCH 1/3] Add AVFrame.pktpts that contains the correctly reordered AVPacket.pts > > --- > doc/APIchanges | 3 +++ > ffplay.c | 4 ++++ > libavcodec/avcodec.h | 19 ++++++++++++++++++- > libavcodec/utils.c | 8 ++++++++ > 4 files changed, 33 insertions(+), 1 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index bf9d11d..3b0dc34 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -13,6 +13,9 @@ libavutil: 2009-03-08 > > API changes, most recent first: > > +2011-01-07 - r26254 - lavc 52.103.0 - pktpts > + Add pktpts to AVFrame Nit++: missing dot.
fixed and a few similar cases too, no doubt i will have forgotton one
[...]
> @@ -1652,6 +1652,8 @@ static int inputgetbuffer(AVCodecContext *codec, AVFrame *pic) > pic->age = INTMAX; > pic->type = FFBUFFERTYPEUSER; > pic->reorderedopaque = codec->reorderedopaque; > + if(codec->pkt) pic->pktpts = codec->pkt->pts; > + else pic->pktpts = AVNOPTSVALUE;
Nit: I'd prefer pic->pktpts = codec->pkt ? codec->pkt->pts : AVNOPTSVALUE; but do as you prefer
i prefer my code, its less obfuscated
[...]
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 828b07a..1ed23eb 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -32,7 +32,7 @@ > #include "libavutil/cpu.h" > > #define LIBAVCODECVERSIONMAJOR 52 > -#define LIBAVCODECVERSIONMINOR 102 > +#define LIBAVCODECVERSIONMINOR 103 > #define LIBAVCODECVERSIONMICRO 0 > _> #define LIBAVCODECVERSIONINT AVVERSIONINT(LIBAVCODECVERSIONMAJOR, _ > @@ -1009,6 +1009,13 @@ typedef struct AVPanScan{ _> * - decoding: Set by libavcodec_ _> */_ _> void *hwaccelpictureprivate;_ _> +_ _> + /**_ _> + * reordered pts from the AVPacket that has been input into the decoder_ _> + * - encoding: unused_ _> + * - decoding: Read by user._ _> + */_ _> + int64t pktpts;_
could you clarify the meaning of "reordered" in this case? Also maybe it's more clear to say: _... from the last AVPacket that has been input into the decoder_
added "last", not sure what is unclear
[...]
> @@ -628,6 +630,9 @@ int attributealignarg avcodecdecodevideo2(AVCodecContext *avctx, AVFrame *pi > *gotpictureptr= 0; > if((avctx->codedwidth||avctx->codedheight) && avimagechecksize(avctx->codedwidth, avctx->codedheight, 0, avctx)) > return -1; > + > + avctx->pkt= avpkt;
Nit+++: avctx->pkt= avpkt;
fixed some of the space nitpiks, again, i likely forgot some
[...]
and patchset commited
-- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Avoid a single point of failure, be that a person or equipment. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110108/7d2c5d4c/attachment.pgp>
- Previous message: [FFmpeg-devel] [PATCH] pkt_pts reordering
- Next message: [FFmpeg-devel] [PATCH] pkt_pts reordering
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]