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

Michael Niedermayer michaelni
Sun May 16 22:37:53 CEST 2010


On Sun, May 16, 2010 at 09:57:03PM +0200, Sebastian Vater wrote:
> Michael Niedermayer a ?crit :
> > 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 ?
> >   
> 
> Fixed by renaming to dst_size.
> 
> Also this patch just does the cosmetical changes, the error checking
> will be handled with a separate patch as suggested by Ronald.

as far as iam concerned, the patch looks ok

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

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- 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/2e41a83c/attachment.pgp>



More information about the ffmpeg-devel mailing list