[MPlayer-dev-eng] unrarlib still broken on 64bit

Peter Cordes peter at cordes.ca
Sun Jul 1 23:56:26 CEST 2007


 Hi mplayer/unrarlib devs,

 I'm not subscribe to the mailing list, please CC on replies thanks.

 unrarlib doesn't work on AMD64.  This thread on mplayer-dev solved the
problem 2 years ago, but the fix isn't in current mplayer SVN.
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2005-April/034149.html
That thread also included a patch to use a standalone unrar executable, if
available, enabling reading of modern rar files.  (I haven't tried it yet
with current mplayer svn sources.)

 Maybe this went unnoticed because 64bit windoze uses a P64 model, where
long is still 32bit, unlike the Unix LP64 ABI, where long is 64bit.  Here's a
better patch that does away with separate defs for win32 and Unix:

--- unrarlib.h.upstream	2007-06-20 01:15:09.000000000 -0300
+++ unrarlib.h	2007-07-01 17:33:55.192251911 -0300
@@ -94,17 +94,11 @@
 #endif
 #endif
 
-#ifdef _WIN_32
-typedef unsigned char    UBYTE;             /* WIN32 definitions            */
-typedef unsigned short   UWORD;
-typedef unsigned long    UDWORD;
-#endif
+#include <stdint.h>
+typedef uint8_t  UBYTE;
+typedef uint16_t UWORD;
+typedef uint32_t UDWORD;
 
-#ifdef _UNIX                                /* LINUX/UNIX definitions       */
-typedef unsigned char    UBYTE;
-typedef unsigned short   UWORD;
-typedef unsigned long    UDWORD;
-#endif
 
 
 /* This structure is used for listing archive content                       */
    

 BTW, I noticed this because mplayer doesn't work with vobsubs in rar files
on my 64bit machine, while the same subtitles still work on my x86 machine
(both with current SVN mplayer).  My patch fixes rar vobsubs on my 64bit
machine.

 It's a pain creating old rar files to be compatible with unrarlib, but
I don't like wasting several MB on uncompressed subs.  (I know it's not
much, but it bugs me.)

 7-zip would appear to be an ideal archive format for vobsubs:  it
compresses very well (better than old compatible rar), it's fast, and is
Free (LGPL), and there's a Free library for accessing 7z files.
http://www.7-zip.org/sdk.html
http://en.wikipedia.org/wiki/7z

 I guess rar is the conventional way, probably because of some windows
thing.  I want to archive movies to dvdr, and I want to be able to copy them
for my friends, so I can't use something that can only be played with a
custom-compiled mplayer. :(  darn crappy standards.  If support for 7z
vobsubs got into VLC, that would pretty much cover all the bases, though.

 But I wish AVI would just die and people would start using mkv.  (it
compresses subs.)

 (I guess this last diatribe, being more of a feature request, is OT for
mplayer-dev-eng, which I'm not subscribed to anyway.)

 Thanks, and happy hacking,

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter at cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 351 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070701/081ade95/attachment.pgp>


More information about the MPlayer-dev-eng mailing list