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

Baptiste Coudurier baptiste.coudurier
Wed May 12 19:00:40 CEST 2010


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.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list