[Ffmpeg-devel] [PATCH] C93 demuxer and decoder (GSoC qualification task)

Michael Niedermayer michaelni
Mon Apr 2 02:17:24 CEST 2007


Hi

On Mon, Apr 02, 2007 at 02:01:52AM +0200, Reimar D?ffinger wrote:
[...]
> > [...]
> > > > +
> > > > +    if (palettesize) {
> > > > +        if (palettesize != 768) {
> > > > +            av_log(s, AV_LOG_ERROR, "invalid palette size %u\n", palettesize);
> > > > +            av_free_packet(pkt);
> > > > +            return AVERROR_INVALIDDATA;
> > > > +        }
> > > > +        ret = get_buffer(pb, pkt->data + 1, palettesize);
> > > > +        if (ret < palettesize) {
> > > > +            av_free_packet(pkt);
> > > > +            return AVERROR_IO;
> > > > +        }
> > > > +    }
> > > > +    url_fskip(pb, -(palettesize + videosize + 2));
> > > 
> > > seeking, especially seeking backwards should be avoided where possible.
> > > Just try playing the file directly from http or ftp and you'll see why.
> > 
> > good argument but you forget something, the whole format is based on reading
> > lists of pointers to packets so this will not work on non seekable protocols
> > anyway ...
> 
> No, I didn't miss that point, I just did not know if/how well the other
> seeking could be avoided, so I commented on the obvious case.
> But regardless of that part, there is quite a bit of seeking back and
> forth in this code which makes it also harder to understand what the
> code does IMO, so this is a part of code that might be worth thinking
> about again and seeing if there's a simpler solution.
> Like passing video and palette around as is. But that would require
> either memcpying things around or resizing the AVPacket.
> Is resizing the AVPacket officially supported? If yes, how is it
> supposed to be done? realloc + change size variable? Or could we need a
> new function for that?

a new function is definitly better though of course av_realloc() would
work too ATM, but if we ever want to change how AVPackets work maybe
caller provided buffers ..., then such direct realloc() could be
annoying ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070402/a01d05a5/attachment.pgp>



More information about the ffmpeg-devel mailing list