[FFmpeg-devel] [PATCH 1/2] avidec: get rid of some magic numbers in read_gab2_sub()

Anton Khirnov anton
Sun Feb 6 22:53:12 CET 2011


On Sun, Feb 06, 2011 at 03:51:17PM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Feb 6, 2011 at 2:31 PM, Anton Khirnov <anton at khirnov.net> wrote:
> > On Sun, Feb 06, 2011 at 03:47:02PM +0100, Michael Niedermayer wrote:
> >> On Sun, Feb 06, 2011 at 03:17:57PM +0100, Reimar D?ffinger wrote:
> >> > On Sun, Feb 06, 2011 at 03:12:25PM +0100, Anton Khirnov wrote:
> >> > > On Sun, Feb 06, 2011 at 11:47:54AM +0100, Reimar D?ffinger wrote:
> >> > > > On Sun, Feb 06, 2011 at 11:07:05AM +0100, Anton Khirnov wrote:
> >> [...]
> >> > > > Also in case the AV_RL16 part is some kind of version number I would
> >> > > > consider this significantly worse, magic number or not.
> >> > > TBH I don't know what that number means, this "format" seems like an
> >> > > undocumented hack (and we can hope no new versions of it will ever be
> >> > > created).
> >> > > Anyway, I don't care much about this patch, I can drop it if you think
> >> > > it does more harm than good.
> >> >
> >> > I don't care either, it just seems a bit pointless to me...
> >>
> >> Id like to second this, and IMHO pointless changes should be avoided for
> >> keeping log & blame clean
> > Fine, first patch dropped.
> > Rebased second patch attached, please review.
> [..]
> > +        ByteIOContext *pb = av_alloc_put_byte(pkt->data + 7,
> > +                                              pkt->size - 7,
> > +                                              0, NULL, NULL, NULL, NULL);
> 
> What's the point of using av_alloc_put_byte() instead of
> init_put_byte() inside lavf?
It allocates a ByteIOContext for me, thus saving me a whole one line of
code. Other than that, I just copied the line that was already there.

-- 
Anton Khirnov
-------------- 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/20110206/4e6db5c3/attachment.pgp>



More information about the ffmpeg-devel mailing list