[MPlayer-dev-eng] [PATCH] vo_tga: fix blue channel on little endian machines

Marton Balint cus at fazekas.hu
Thu Jun 10 01:18:32 CEST 2010


On Wed, 9 Jun 2010, Reimar Döffinger wrote:
> On Wed, Jun 09, 2010 at 09:16:57PM +0200, Marton Balint wrote:
>> +            while (dy-- > 0) {
>> +                if (fwrite(buf, wb, 1, fo) != 1) {
>> +                    er = 4;
>> +                    break;
>>                  }
>> -
>> +                buf += stride;
>>              }
>> -            else {
>> -                while (dy-- > 0) {
>> -                    if (fwrite(buf, wb, 1, fo) != 1) {
>> -                        er = 4;
>> -                        break;
>> -                    }
>> -                    buf += stride;
>
> Please don't change indentation, it's easier to check for mistakes without it
> and then fix the indentation later.

Sorry, I fixed the patch to use the original identation.

>> @@ -236,7 +196,11 @@
>>      switch(format){
>>          case IMGFMT_BGR|15:
>>          case IMGFMT_BGR|24:
>> -        case IMGFMT_BGR|32:
>> +        #if HAVE_BIGENDIAN
>> +        case IMGFMT_ARGB:
>> +        #else
>> +        case IMGFMT_BGRA:
>> +        #endif
>
> That's just a more complicated way of writing the same thing actually,
> so this part should be unnecessary.

OK, I removed the HAVE_BIGENDIAN check.

Regards,
   Marton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vo_tga-fix-blue-channel-3.patch
Type: text/x-patch
Size: 2624 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100610/f8f2928e/attachment.bin>


More information about the MPlayer-dev-eng mailing list