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

Sebastian Vater cdgs.basty
Sun May 16 21:57:03 CEST 2010


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.

-- 

Best regards,
                   :-) Basty/CDGS (-:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-function-merge.patch
Type: text/x-patch
Size: 5332 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100516/46b017eb/attachment.bin>



More information about the ffmpeg-devel mailing list