[FFmpeg-devel] [PATCH] Compute proper pkt->pos in mxfdec.c

Tomas Härdin tomas.hardin
Mon May 17 09:22:45 CEST 2010

On Wed, 2010-05-12 at 10:00 -0700, Baptiste Coudurier wrote:
> On 5/12/10 7:48 AM, Tomas H?rdin wrote:
> > Hi
> >
> > Today I noticed that the MXF demuxer calculates incorrect values for its
> > packet offsets (pkt->pos). They point at the start of the KLV triplets,
> > not the essence data itself (which is what pos is for unless I'm
> > mistaken).
> >
> > The attached patch fixes this by setting pkt->pos to klv.offset + 16 +
> > berlength, where 16 is the length of a UID and berlength is the length
> > of the BER encoded length (typically 4). The patch also adjusts the
> > regtests since the offsets were wrong (adjusted +20).
> >
> > Tests pass on r23083. Current revision does not pass tests on its own,
> > so I can't test against that.
> >
> pkt->pos must point there, this is not a bug. It points to the start the 
> underlying format packet, like in TS where it points to the 0x47 byte, 
> and in PS it points to the startcode.
> The seeking code can seek to that position, call read_packet, and get 
> the same packet.

It seems I have misunderstood the purpose of pkt->pos then.
Unfortunately the documentation for it is quite lacking, so I dug around
the code and assumed its purpose was to point to the data itself since
that's that av_get_packet() does.

Patch redacted. Seems I'll have to solve my problem some other way.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100517/b6a22c65/attachment.pgp>

More information about the ffmpeg-devel mailing list