[DVDnav-discuss] "libdvdread: Invalid main menu IFO" on ppc [PATCH]
Dominik 'Rathann' Mierzejewski
dominik at greysector.net
Sun Sep 27 02:21:57 CEST 2009
On Friday, 01 August 2008 at 00:14, Dominik 'Rathann' Mierzejewski wrote:
> On Sunday, 27 April 2008 at 11:51, Nico Sabbi wrote:
> > Il Monday 21 April 2008 21:56:42 Dominik 'Rathann' Mierzejewski ha scritto:
> >
> > > ------- Additional Comments From mike at flyn.org 2008-04-20 13:16 EST -------
> > > Created an attachment (id=303059)
> > > --> (https://bugzilla.redhat.com/attachment.cgi?id=303059&action=view)
> > > VIDEO_TS.IFO from The Last of the Mohicans
> > >
> > > I also tried libdvdnav-4.1.2-1.fc9 and found that I still had this problem.
> >
> > please, svn update and report where it fails (I added some overdue debug message)
>
> Sorry it took so long. The output below is produced using libdvdread r1043 from
> before the split. I hope it's good enough.
OK, I think the culprit has been found. src/bswap.h depends on WORD_BIGENDIAN
being defined on big-endian arch to select appropriate macros. configure2
does not produce that definition in config.h, so the code ends up being
incorrect on ppc and other big-endian arches.
I'm attaching a quick and dirty patch to fix that (the test method is taken
from FFmpeg's configure). Maybe Diego has some idea how to improve it.
Also we need someone with a ppc to test it.
Regards,
R.
--
Fedora http://fedoraproject.org/wiki/User:Rathann
RPMFusion http://rpmfusion.org | MPlayer http://mplayerhq.hu
"Faith manages."
-- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
-------------- next part --------------
diff -up libdvdread-4.1.4/configure2.endian libdvdread-4.1.4/configure2
--- libdvdread-4.1.4/configure2.endian 2009-09-27 00:23:58.000000000 +0200
+++ libdvdread-4.1.4/configure2 2009-09-27 01:26:56.000000000 +0200
@@ -108,6 +108,19 @@
;;
esac
+echo -n "Checking if we're big-endian... "
+bigendian=no
+TMPD=`mktemp -d`
+TMPC=$TMPD/endian.c
+TMPO=$TMPD/endian.o
+cat > $TMPC <<EOF
+unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
+EOF
+$cc $optimizations $cflags -c -o $TMPO $TMPC
+od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && bigendian=yes
+rm -rf $TMPD
+echo "$bigendian"
+
cat > config.mak << EOF
# Automatically generated by configure, do not edit
PREFIX=$PREFIX
@@ -136,6 +149,7 @@
/* Automatically generated by configure, do not edit */
#include "version.h"
EOF
+test "$bigendian" == "yes" && echo "#define WORDS_BIGENDIAN" >> config.h || echo "#undef WORDS_BIGENDIAN" >> config.h
# build tree in object directory if source path is different from current one
if test "$source_path_used" != "no"; then
More information about the DVDnav-discuss
mailing list