[FFmpeg-devel] [PATCH] Demuxer for Leitch/Harris' VR native stream format (LXF)

Tomas Härdin tomas.hardin
Mon Sep 27 09:59:40 CEST 2010


On Sat, 2010-09-25 at 05:22 +0200, Michael Niedermayer wrote:
> > +
> > +/**
> > + * Read and checksum the next packet header
> > + *
> > + * @param[out] header the read packet header
> > + * @param[out] format context dependent format information
> > + * @return the size of the payload following the header or < 0 on failure
> > + */
> > +static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *format)
> > +{
> > +    ByteIOContext   *pb  = s->pb;
> > +    int size, track_size, samples;
> > +    AVStream *st;
> > +
> > +    if (get_buffer(pb, header, LXF_PACKET_HEADER_SIZE) != LXF_PACKET_HEADER_SIZE)
> > +        return AVERROR(EIO);
> > +
> > +    if (memcmp(header, LXF_IDENT, LXF_IDENT_LENGTH)) {
> > +        av_log(s, AV_LOG_ERROR, "packet ident mismatch - out of sync?\n");
> > +        return -1;
> > +    }
> 
> searching for the next matching ident instead of failing would make sense

I had thought of that, but forgot to implement it. Updated patch
attached. I tested it by corrupting a bunch of idents in my test files.
Worked great, except for the obvious packet loss artifacts.

Both patches attached since I rebased against the latest revision.

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lxfdec6.patch
Type: text/x-patch
Size: 14567 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100927/db9c6ca9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcm_lxf2.patch
Type: text/x-patch
Size: 4068 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100927/db9c6ca9/attachment-0001.bin>
-------------- 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/20100927/db9c6ca9/attachment.pgp>



More information about the ffmpeg-devel mailing list