[FFmpeg-devel] [PATCH] IFF: Merge lots of duplicate code into a single function

Michael Niedermayer michaelni
Sun May 16 20:43:34 CEST 2010


On Sun, May 16, 2010 at 06:29:10PM +0200, Sebastian Vater wrote:
> Ronald S. Bultje a ?crit :
> > Hi,
> >
> > On Sun, May 16, 2010 at 12:06 PM, Sebastian Vater
> > <cdgs.basty at googlemail.com> wrote:
> >   
> >> Besides this, I added Stefano's hint about get_buffer returning err
> >> instead -1 here, since I had to introduce err variable here anyway.
> >>     
> > [..]
> >   
> >> -    if (avctx->reget_buffer(avctx, &s->frame) < 0){
> >> +    if ((err = avctx->reget_buffer(avctx, &s->frame)) < 0) {
> >>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
> >> -        return -1;
> >> +        return err;
> >>      }
> >>     
> >
> > Well, that should be a separate patch, but is OK otherwise... Rest of
> > patch is OK also..
> >   
> 
> Fixed!
> 
> -- 
> 
> Best regards,
>                    :-) Basty/CDGS (-:
> 

>  iff.c |   94 +++++++++++++++++++++++++++++++++---------------------------------
>  1 file changed, 48 insertions(+), 46 deletions(-)
> 30e5c9851b50c8cbf40eff5ed72f51bda2fc5b39  iff-function-merge.patch
> diff --git a/libavcodec/iff.c b/libavcodec/iff.c
> index 872c81f..935b0fb 100644
> --- a/libavcodec/iff.c
> +++ b/libavcodec/iff.c
> @@ -219,6 +219,44 @@ static void decodeplane32(uint32_t *dst, const uint8_t *buf, int buf_size, int p
>      } while (--buf_size);
>  }
>  
> +/**
> + * Decodes one complete byterun1 encoded line.
> + *
> + * @param dst the destination buffer where to store decompressed bitstream
> + * @param buf the source byterun1 compressed bitstream
> + * @param buf_end the EOF of source byterun1 compressed bitstream

> + * @param buf_size the plane size in bytes

is this dst_size or buf_size ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100516/bb7d80ea/attachment.pgp>



More information about the ffmpeg-devel mailing list