[FFmpeg-devel] [PATCH] fix some warnings in swscale.c

Michael Niedermayer michaelni
Mon Oct 27 08:20:55 CET 2008


On Sun, Oct 26, 2008 at 10:51:41PM +0100, Vitor Sessak wrote:
> Michael Niedermayer wrote:
>> On Sun, Oct 26, 2008 at 04:42:25PM +0100, Vitor Sessak wrote:
>>> Michael Niedermayer wrote:
>>>> On Sat, Oct 25, 2008 at 10:26:45PM +0200, Vitor Sessak wrote:
>>>>> $Subj.
>>>>>
>>>>> -Vitor
>>>>> Index: libswscale/swscale.c
>>>>> ===================================================================
>>>>> --- libswscale/swscale.c	(revision 27818)
>>>>> +++ libswscale/swscale.c	(working copy)
>>>>> @@ -1741,7 +1741,7 @@
>>>>>        for (i=0; i<srcSliceH; i++) {
>>>>> -        conv(srcPtr, dstPtr, c->srcW, c->pal_rgb);
>>>>> +        conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb);
>>>>>          srcPtr+= srcStride[0];
>>>>>          dstPtr+= dstStride[0];
>>>>>      }
>>>> ok
>>> Applied this part.
>>>
>>>>> @@ -2717,27 +2717,34 @@
>>>>>      if (usePal(c->srcFormat)){
>>>>>          for (i=0; i<256; i++){
>>>>>              int p, r, g, b,y,u,v;
>>>>> -            if(c->srcFormat == PIX_FMT_PAL8){
>>>>> +            switch(c->srcFormat) {
>>>>> +            case PIX_FMT_PAL8:
>>>> this does not look like a warning fix
>>> No, but I find that using a switch() the warning fix is more readable. 
>>> Attached is the straightforward version.
>> i am not arguing in favor or against either if or switch but changing from
>> one to the other does not belong in a warning fix IMHO
>> [...]
>>> Index: libswscale/swscale.c
>>> ===================================================================
>>> --- libswscale/swscale.c	(revision 27834)
>>> +++ libswscale/swscale.c	(working copy)
>>> @@ -2734,7 +2734,7 @@
>>>                  r= (i>>3    )*255;
>>>                  g= ((i>>1)&3)*85;
>>>                  b= (i&1     )*255;
>>> -            }else if(c->srcFormat == PIX_FMT_BGR4_BYTE){
>>> +            }else { //if(c->srcFormat == PIX_FMT_BGR4_BYTE){
>> id write it as an assert() instead of a comment, has the advantage that
>> it might catch a bug ...
>
> Ok, attached.

ok

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

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- 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/20081027/aadda695/attachment.pgp>



More information about the ffmpeg-devel mailing list