On Sat, 11 Feb 2012 14:35:48 -0800, "Ronald S. Bultje" <[email protected]> wrote: > Hi, > > On Sat, Feb 11, 2012 at 12:25 PM, Anton Khirnov <[email protected]> wrote: > > --- > > libavcodec/asv1enc.c | 29 +++++++++++++++++++---------- > > 1 files changed, 19 insertions(+), 10 deletions(-) > [..] > > + if (!pkt->data && > > + (ret = av_new_packet(pkt, > > FFALIGN(a->mb_width*a->mb_height*MAX_MB_SIZE, 32))) < 0) > > + return ret; > > + > > + init_put_bits(&a->pb, pkt->data, pkt->size); > > ? Why is this code different than for the others? >
ff_alloc_packet() means 'ensure we have at least this much space' In this case, the encoder doesn't know how much space it will need, so it's just guessing and upper bound. If the user provided a buffer, we use it and it will fail later in encode_mb() if it's not large enough. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
