On 2013-03-23 00:40:00 +0100, Luca Barbato wrote:
> On 22/03/13 15:30, Anton Khirnov wrote:
> > Needed e.g. for h264 cropping to work properly.
> > ---
> >  libavcodec/utils.c |   25 ++++++++++++++++++++++---
> >  1 file changed, 22 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > index 42493e1..4a1ea08 100644
> > --- a/libavcodec/utils.c
> > +++ b/libavcodec/utils.c
> > @@ -550,14 +550,19 @@ static void compat_release_buffer(void *opaque, 
> > uint8_t *data)
> >  
> >  int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
> >  {
> > +    int orig_width = 0, orig_height = 0;
> >      int ret;
> >  
> >      switch (avctx->codec_type) {
> >      case AVMEDIA_TYPE_VIDEO:
> >          if (!frame->width)
> > -            frame->width               = avctx->width;
> > +            frame->width               = FFMAX(avctx->width, 
> > avctx->coded_width);
> 
> align it with the line below.
> 
> > +        else
> > +            orig_width = frame->width;
> >          if (!frame->height)
> > -            frame->height              = avctx->height;
> > +            frame->height              = FFMAX(avctx->height, 
> > avctx->coded_height);
> > +        else
> 
> same nit as above
> 
> The rest seems ok even if a bit harder to follow than it should. (no
> idea on how making it simpler.)

see my reservations in the other thread. I don't think we need three
different ways to specify the frame buffer size.

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to