[FFmpeg-devel] [PATCH 1/2] avidec: get rid of some magic numbers in read_gab2_sub()
Ronald S. Bultje
rsbultje
Mon Feb 7 02:31:23 CET 2011
Hi,
On Sun, Feb 6, 2011 at 4:53 PM, Anton Khirnov <anton at khirnov.net> wrote:
> 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.
I guess it was already there, n/m then. The addition of the av_free()
confused me but it's already there for the non-error condition.
Queued.
Ronald
More information about the ffmpeg-devel
mailing list