[MPlayer-dev-eng] unneded? hack on vd_raw makes rgb16 fail [PATCH]

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 22 11:14:00 CEST 2006


Hello,
On Sun, Oct 22, 2006 at 10:54:57AM +0200, Reimar D?ffinger wrote:
> On Sun, Oct 22, 2006 at 03:53:16AM -0300, Reynaldo H. Verdejo Pinochet wrote:
> > Im here proposing the idea of simply remove this hack, patch attached
> > , id happily (not really true) work on a cleaner fix ON THE AVI DEMUXER
> > if this turns out to be needed for some (weird) sample out there and
> > if and once someone provide such material.
> > 
> > going to commit unless someone has good reasons to do otherwise and
> > a sample thats worth the ugly hack herein discussed.
> 
> I repeat again what I said on IRC: IMGFMT_BGR15 actually is 16 bpp,
> unfortunate as it maybe, as each pixel allocates 16 bits of memory.
> Otherwise IMGFMT_BGR32 would have to be 24 bpp, and the right solution
> is to set sh->format in demux_lavf.c

Actually the right way is to set biCompression, like in attached patch.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/demux_lavf.c
===================================================================
--- libmpdemux/demux_lavf.c	(revision 20347)
+++ libmpdemux/demux_lavf.c	(working copy)
@@ -29,6 +29,7 @@
 #include "demuxer.h"
 #include "stheader.h"
 #include "m_option.h"
+#include "libmpcodecs/img_format.h"
 
 #ifdef USE_LIBAVFORMAT_SO
 #include <ffmpeg/avformat.h>
 #include <ffmpeg/opt.h>
@@ -279,6 +292,8 @@
 	    priv->video_streams++;
             if(!codec->codec_tag)
                 codec->codec_tag= codec_get_bmp_tag(codec->codec_id);
+            if (!codec->codec_tag && codec->codec_id == CODEC_ID_RAWVIDEO)
+                codec->codec_tag = IMGFMT_BGR | codec->bits_per_sample;
             bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size;
             bih->biWidth= codec->width;
             bih->biHeight= codec->height;


More information about the MPlayer-dev-eng mailing list