[MPlayer-cvslog] r22094 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Wed Jan 31 19:14:48 CET 2007


Author: reimar
Date: Wed Jan 31 19:14:47 2007
New Revision: 22094

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Log:
Swap palette on bigendian.


Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	(original)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Wed Jan 31 19:14:47 2007
@@ -717,6 +717,12 @@
     uint32_t chunktab;	// offset to chunk offset array
 } dp_hdr_t;
 
+void swap_palette(void *pal) {
+    int i;
+    uint32_t *p = pal;
+    for (i = 0; i < AVPALETTE_COUNT; i++)
+        p[i] = le2me_32(p[i]);
+}
 
 // decode a frame
 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
@@ -884,6 +890,11 @@
 	mpi->stride[2]*=2;
     }
     
+#ifdef WORDS_BIGENDIAN
+    // FIXME: this might cause problems for buffers with FF_BUFFER_HINTS_PRESERVE
+    if (mpi->bpp == 8)
+        swap_palette(mpi->planes[1]);
+#endif
 /* to comfirm with newer lavc style */
     mpi->qscale =pic->qscale_table;
     mpi->qstride=pic->qstride;



More information about the MPlayer-cvslog mailing list