[MPlayer-users] AMR on amd64 error.

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Thu May 18 11:00:28 CEST 2006


On Thursday, 18 May 2006 at 02:58, Gaute Strokkenes wrote:
> I have some videos in .3gp format lying about the place.  So recently
> I followed the instructions in amr.c and downloaded the
> (floating-point) reference codec, put the code in a directory called
> amr_float within libavcodec and compiled.
> 
> When I played the file the only sound produced was horrible noise.
> This surprised me, since I had it working on my previous system.
> 
> A cursory examination of amr_float/typedef.h reveals the highly
> suspicious statement "typedef long Word32;", which is definitely wrong
> on LP64 architectures.  (Presumably the code was developed with 16-bit
> machines in mind, but never mind.)  Changing this to "typedef int
> Word32;" produces a working amr_nb decoder.

Confirmed.

> I would have attached a patch, but it's not clear to my how this
> should be fixed since the file isn't in-tree.  Possibly configure
> could try to patch the file (yuck) or there could be a notice in amr.c
> or something.

Try the attached patch.

Regards,
R.

-- 
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20060517/libavcodec/amr_float/typedef.h.amr	2004-03-05 00:00:02.000000000 +0100
+++ MPlayer-20060517/libavcodec/amr_float/typedef.h	2006-05-18 10:57:03.000000000 +0200
@@ -12,10 +12,12 @@
 #ifndef _TYPEDEF_H
 #define _TYPEDEF_H
 
-typedef char Word8;
-typedef unsigned char UWord8;
-typedef short Word16;
-typedef long Word32;
+#include <inttypes.h>
+
+typedef int8_t Word8;
+typedef uint8_t UWord8;
+typedef int16_t Word16;
+typedef int32_t Word32;
 typedef float Float32;
 typedef double Float64;
 
--- MPlayer-20060517/libavcodec/amrwb_float/typedef.h.amr	2003-08-27 00:00:02.000000000 +0200
+++ MPlayer-20060517/libavcodec/amrwb_float/typedef.h	2006-05-18 10:58:46.000000000 +0200
@@ -6,13 +6,15 @@
 #ifndef typedef_h
 #define typedef_h
 
+#include <inttypes.h>
+
 /* change these typedef declarations to correspond with your platform */
-typedef char Word8;
-typedef unsigned char UWord8;
-typedef short Word16;
-typedef unsigned short UWord16;
-typedef long Word32;
+typedef int8_t Word8;
+typedef uint8_t UWord8;
+typedef int16_t Word16;
+typedef uint16_t UWord16;
+typedef int32_t Word32;
 typedef double Float64;
 typedef float Float32;
 
-#endif
\ No newline at end of file
+#endif


More information about the MPlayer-users mailing list