aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpcodecs
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-31 18:14:47 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-31 18:14:47 +0000
commit2b9be36ccc435082a04094f00a71de1068c2287c (patch)
tree2478d580de4f9ff997c3a32aeea3f0622f68b45f /libmpcodecs
parente13254013719c357ca404c75dd38d47f75495ae4 (diff)
Swap palette on bigendian.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22094 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 26eacd3ff1..2b993c4a93 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -717,6 +717,12 @@ typedef struct dp_hdr_s {
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
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;