[MPlayer-dev-eng] [PATCH] nuv on bigendian
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Feb 21 13:40:09 CET 2005
Hi,
can somebody please test this patch on bigendian and/or comment on it?
See also http://bugzilla.mplayerhq.hu/show_bug.cgi?id=237
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/demux_nuv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_nuv.c,v
retrieving revision 1.11
diff -u -r1.11 demux_nuv.c
--- libmpdemux/demux_nuv.c 30 Sep 2002 21:10:41 -0000 1.11
+++ libmpdemux/demux_nuv.c 21 Feb 2005 11:42:28 -0000
@@ -69,6 +69,7 @@
{
if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
return; /* EOF */
+ le2me_frameheader(&rtjpeg_frameheader);
if ( rtjpeg_frameheader.frametype == 'V' )
{
@@ -145,6 +146,7 @@
demuxer->filepos = orig_pos = stream_tell ( demuxer->stream );
if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
return 0; /* EOF */
+ le2me_frameheader(&rtjpeg_frameheader);
#if 0
printf("NUV frame: frametype: %c, comptype: %c, packetlength: %d\n",
@@ -218,6 +220,7 @@
stream_seek(demuxer->stream, 0);
stream_read ( demuxer->stream, (char*)& rtjpeg_fileheader, sizeof(rtjpeg_fileheader) );
+ le2me_fileheader(&rtjpeg_fileheader);
/* no video */
if (rtjpeg_fileheader.videoblocks == 0)
Index: libmpdemux/nuppelvideo.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/nuppelvideo.h,v
retrieving revision 1.1
diff -u -r1.1 nuppelvideo.h
--- libmpdemux/nuppelvideo.h 27 Dec 2001 22:20:15 -0000 1.1
+++ libmpdemux/nuppelvideo.h 21 Feb 2005 11:42:29 -0000
@@ -90,3 +90,23 @@
unsigned char *buffer_offset;
} audbuffertyp;
+#ifdef WORDS_BIGENDIAN
+#define le2me_rtfileheader(h) { \
+ (h)->width = le2me_32((h)->width); \
+ (h)->height = le2me_32((h)->height); \
+ (h)->desiredwidth = le2me_32((h)->desiredwidth); \
+ (h)->desiredheight = le2me_32((h)->desiredheight); \
+ (h)->videoblocks = le2me_32((h)->videoblocks); \
+ (h)->audioblocks = le2me_32((h)->audioblocks); \
+ (h)->textsblocks = le2me_32((h)->textsblocks); \
+ (h)->keyframedist = le2me_32((h)->keyframedist); \
+ }
+#define le2me_rtframeheader(h) { \
+ (h)->timecode = le2me_32((h)->timecode); \
+ (h)->packetlength = le2me_32((h)->packetlength); \
+ }
+#else
+#define le2me_rtfileheader(h) /**/
+#define le2me_rtframeheader(h) /**/
+#endif
+
More information about the MPlayer-dev-eng
mailing list