[FFmpeg-devel] [PATCH] os2 (v1?) support for BMP

Benoit Fouet benoit.fouet
Tue Mar 25 16:41:20 CET 2008


Hi,

Benjamin Larsson wrote:
> Benoit Fouet wrote:
>   
>> Hi,
>>
>> width and height are stored on 16 bits in this case, this patch gets
>> them right and allows to decode os2 BMP files with 24 bits per pixel.
>>
>> BTW, if someone has a reference document for BMP, I'd like to complete
>> the decoder so that it supports all other headers.
>>
>>   
>> ------------------------------------------------------------------------
>>
>> Index: libavcodec/bmp.c
>> ===================================================================
>> --- libavcodec/bmp.c	(revision 12579)
>> +++ libavcodec/bmp.c	(working copy)
>> @@ -84,8 +84,16 @@
>>          return -1;
>>      }
>>  
>> +    if (ihsize == 40) {
>>      width = bytestream_get_le32(&buf);
>>      height = bytestream_get_le32(&buf);
>> +    } else if (ihsize == 12) {
>> +        width  = bytestream_get_le16(&buf);
>> +        height = bytestream_get_le16(&buf);
>> +    } else {
>> +      av_log(avctx, AV_LOG_ERROR, "unsupported BMP file, patch welcome");
>> +      return -1;
>> +    }
>>   
>>     
>
> Don't forget the indentation.
>
>   

Oops, indeed...
new patch attached...

Thanks

-- 
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bmp.c.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080325/9eb1b63e/attachment.asc>



More information about the ffmpeg-devel mailing list