2008-05-26, 04:50
When attempting to play an M4A/AAC file under x86_64, AACCodec fails with this error message:
This message suggests that the file is malformed, but it is not. Under 32-bit Linux, other players (iTunes on OS X), or XBMC-Xbox, the files play correctly.
This is an old bug bug related to libfaad, resulting from the use of ambiguous types (unsigned long, etc) instead of specific ones (uint32_t, etc):
http://bugs.gentoo.org/show_bug.cgi?id=58780
http://bugs.gentoo.org/show_bug.cgi?id=61528
http://mail-index.netbsd.org/pkgsrc-bugs.../0012.html
I've been trying to fix it by building AACCodec with a newer version of libfaad, but I'm running into -fPIC problems that I can't seem to get around.
I added CFLAGS=-fPIC to libfaad's Makefile.am, and it does appear that all the .c files are being compiled with -fPIC, including bits.o, but I get the same error.
Code:
17:57:49 T:2585143360 M:294600704 ERROR: AACCodec: Unable to open file /mnt/music/file.m4a (Pulse coding not allowed in short blocks)
This message suggests that the file is malformed, but it is not. Under 32-bit Linux, other players (iTunes on OS X), or XBMC-Xbox, the files play correctly.
This is an old bug bug related to libfaad, resulting from the use of ambiguous types (unsigned long, etc) instead of specific ones (uint32_t, etc):
http://bugs.gentoo.org/show_bug.cgi?id=58780
http://bugs.gentoo.org/show_bug.cgi?id=61528
http://mail-index.netbsd.org/pkgsrc-bugs.../0012.html
I've been trying to fix it by building AACCodec with a newer version of libfaad, but I'm running into -fPIC problems that I can't seem to get around.
Code:
gcc -shared -o AACCodec-i486-linux.so *.o alac_decoder/*.o faad2/libfaad/*.o mp4ff/*.o `cat ../../../XBMC/xbmc/cores/DllLoader/exports/wrapper.def` ../../../XBMC/xbmc/cores/DllLoader/exports/wrapper.o
/usr/bin/ld: faad2/libfaad/bits.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
faad2/libfaad/bits.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [AACCodec-i486-linux.so] Error 1
I added CFLAGS=-fPIC to libfaad's Makefile.am, and it does appear that all the .c files are being compiled with -fPIC, including bits.o, but I get the same error.