[SCM] libbluray/master: Revert "Imported Upstream version 0.2~git20110613.e93aa91"

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jul 10 14:03:45 UTC 2011


The following commit has been merged in the master branch:
commit 102eac7761021cb46b42867d1ed583fa70a3341a
Author: Reinhard Tartler <siretart at tauware.de>
Date:   Sun Jul 10 15:41:59 2011 +0200

    Revert "Imported Upstream version 0.2~git20110613.e93aa91"
    
    This reverts commit cbb1ad33c26eaae962fc30623af17e6aa4fd9d88.
    
    This is to undo the API/ABI break without SONAME bump. Revert this
    revert before upgrading to the next upstream release

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 40eaed4..c2246a4 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
 
-timestamp='2011-05-11'
+timestamp='2009-12-30'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
 Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -181,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-		os=netbsd
+	        os=netbsd
 		;;
 	esac
 	# The OS release
@@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 		;;
 	*5.*)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 		;;
 	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -270,10 +270,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-	exitcode=$?
-	trap '' 0
-	exit $exitcode ;;
+	exit ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
@@ -299,7 +296,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo s390-ibm-zvmoe
 	exit ;;
     *:OS400:*:*)
-	echo powerpc-ibm-os400
+        echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
@@ -398,23 +395,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+        echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+        echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
-	exit ;;
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
-	exit ;;
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
-	exit ;;
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
 	exit ;;
@@ -484,8 +481,8 @@ EOF
 	echo m88k-motorola-sysv3
 	exit ;;
     AViiON:dgux:*:*)
-	# DG/UX returns AViiON for all architectures
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -498,7 +495,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
-	exit ;;
+ 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -555,7 +552,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[4567])
+    *:AIX:*:[456])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -598,52 +595,52 @@ EOF
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
-		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
-			  32) HP_ARCH="hppa2.0n" ;;
-			  64) HP_ARCH="hppa2.0w" ;;
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-			esac ;;
-		    esac
+                        esac ;;
+                    esac
 		fi
 		if [ "${HP_ARCH}" = "" ]; then
 		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
+		    sed 's/^              //' << EOF >$dummy.c
 
-		#define _HPUX_SOURCE
-		#include <stdlib.h>
-		#include <unistd.h>
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
 
-		int main ()
-		{
-		#if defined(_SC_KERNEL_BITS)
-		    long bits = sysconf(_SC_KERNEL_BITS);
-		#endif
-		    long cpu  = sysconf (_SC_CPU_VERSION);
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
 
-		    switch (cpu)
-			{
-			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-			case CPU_PA_RISC2_0:
-		#if defined(_SC_KERNEL_BITS)
-			    switch (bits)
-				{
-				case 64: puts ("hppa2.0w"); break;
-				case 32: puts ("hppa2.0n"); break;
-				default: puts ("hppa2.0"); break;
-				} break;
-		#else  /* !defined(_SC_KERNEL_BITS) */
-			    puts ("hppa2.0"); break;
-		#endif
-			default: puts ("hppa1.0"); break;
-			}
-		    exit (0);
-		}
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
 EOF
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -734,22 +731,22 @@ EOF
 	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-	exit ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-	exit ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-	exit ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-	exit ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-	exit ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
@@ -773,14 +770,14 @@ EOF
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
     5000:UNIX_System_V:4.*:*)
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -808,14 +805,14 @@ EOF
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
     i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
 	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
     *:Interix*:*)
-	case ${UNAME_MACHINE} in
+    	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
@@ -870,7 +867,7 @@ EOF
 	  EV6)   UNAME_MACHINE=alphaev6 ;;
 	  EV67)  UNAME_MACHINE=alphaev67 ;;
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
-	esac
+        esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
@@ -882,13 +879,7 @@ EOF
 	then
 	    echo ${UNAME_MACHINE}-unknown-linux-gnu
 	else
-	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
-		| grep -q __ARM_PCS_VFP
-	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
-	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
-	    fi
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
@@ -901,7 +892,7 @@ EOF
 	echo crisv32-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-	echo frv-unknown-linux-gnu
+    	echo frv-unknown-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	LIBC=gnu
@@ -969,7 +960,7 @@ EOF
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -977,9 +968,6 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
-    tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-tilera-linux-gnu
-	exit ;;
     vax:Linux:*:*)
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
@@ -987,7 +975,7 @@ EOF
 	echo x86_64-unknown-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -996,11 +984,11 @@ EOF
 	echo i386-sequent-sysv4
 	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-	# Unixware is an offshoot of SVR4, but it has its own version
-	# number series starting with 2...
-	# I am not positive that other SVR4 systems won't match this,
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-	# Use sysv4.2uw... so that sysv4* matches it.
+        # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit ;;
     i*86:OS/2:*:*)
@@ -1032,7 +1020,7 @@ EOF
 	fi
 	exit ;;
     i*86:*:5:[678]*)
-	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
@@ -1060,13 +1048,13 @@ EOF
 	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
-	# uname -m prints for DJGPP always 'pc', but it prints nothing about
-	# the processor, so we play safe by assuming i586.
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i586.
 	# Note: whatever this is, it MUST be the same as what config.sub
 	# prints for the "djgpp" host, or else GDB configury will decide that
 	# this is a cross-build.
 	echo i586-pc-msdosdjgpp
-	exit ;;
+        exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1101,8 +1089,8 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4; exit; } ;;
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
 	OS_REL='.3'
 	test -r /etc/.relid \
@@ -1145,10 +1133,10 @@ EOF
 		echo ns32k-sni-sysv
 	fi
 	exit ;;
-    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-			# says <Richard.M.Bartel at ccMail.Census.GOV>
-	echo i586-unisys-sysv4
-	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
@@ -1174,11 +1162,11 @@ EOF
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
+	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
+	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-	exit ;;
+        exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
 	exit ;;
@@ -1243,9 +1231,6 @@ EOF
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
-	exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
@@ -1291,13 +1276,13 @@ EOF
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
+        echo mips-sei-seiux${UNAME_RELEASE}
 	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit ;;
     *:*VMS:*:*)
-	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
@@ -1337,11 +1322,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-	"4"
+          "4"
 #else
-	""
+	  ""
 #endif
-	); exit (0);
+         ); exit (0);
 #endif
 #endif
 
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 30fdca8..c2d1257 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
 
-timestamp='2011-03-23'
+timestamp='2010-01-22'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -76,7 +76,7 @@ version="\
 GNU config.sub ($timestamp)
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
 Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -124,9 +124,8 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -158,8 +157,8 @@ case $os in
 		os=
 		basic_machine=$1
 		;;
-	-bluegene*)
-		os=-cnk
+        -bluegene*)
+	        os=-cnk
 		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
@@ -175,10 +174,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
-	-chorusrdb)
-		os=-chorusrdb
+ 	-chorusrdb)
+ 		os=-chorusrdb
 		basic_machine=$1
-		;;
+ 		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -283,13 +282,11 @@ case $basic_machine in
 	| moxie \
 	| mt \
 	| msp430 \
-	| nds32 | nds32le | nds32be \
 	| nios | nios2 \
 	| ns16k | ns32k \
-	| open8 \
 	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
 	| rx \
 	| score \
@@ -297,24 +294,15 @@ case $basic_machine in
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e \
 	| we32k \
-	| x86 | xc16x | xstormy16 | xtensa \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
-		;;
 	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
 		# Motorola 68HC11/12.
 		basic_machine=$basic_machine-unknown
@@ -326,18 +314,6 @@ case $basic_machine in
 		basic_machine=mt-unknown
 		;;
 
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
-		;;
-
-	xscaleeb)
-		basic_machine=armeb-unknown
-		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
-		;;
-
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -358,7 +334,7 @@ case $basic_machine in
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
@@ -392,28 +368,26 @@ case $basic_machine in
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
 	| nios-* | nios2-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
-	| tahoe-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tile-* | tilegx-* \
 	| tron-* \
 	| ubicom32-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
 	| z8k-* | z80-*)
@@ -438,7 +412,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-	abacus)
+    	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -508,20 +482,11 @@ case $basic_machine in
 		basic_machine=powerpc-ibm
 		os=-cnk
 		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
-	cegcc)
+        cegcc)
 		basic_machine=arm-unknown
 		os=-cegcc
 		;;
@@ -553,7 +518,7 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16 | cr16-*)
+	cr16)
 		basic_machine=cr16-unknown
 		os=-elf
 		;;
@@ -769,7 +734,7 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-	microblaze)
+        microblaze)
 		basic_machine=microblaze-xilinx
 		;;
 	mingw32)
@@ -876,12 +841,6 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -964,10 +923,9 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
+	ppc)	basic_machine=powerpc-unknown
 		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -1061,9 +1019,6 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -1120,8 +1075,20 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	# This must be matched before tile*.
-	tilegx*)
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+        # This must be matched before tile*.
+        tilegx*)
 		basic_machine=tilegx-unknown
 		os=-linux-gnu
 		;;
@@ -1196,9 +1163,6 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
-		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1296,11 +1260,11 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
+        # First match some system type aliases
+        # that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
+        -auroraux)
+	        os=-auroraux
 		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1337,8 +1301,7 @@ case $os in
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1385,7 +1348,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-	-os400*)
+        -os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1434,7 +1397,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-	-tpf*)
+        -tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1479,8 +1442,8 @@ case $os in
 	-dicos*)
 		os=-dicos
 		;;
-	-nacl*)
-		;;
+        -nacl*)
+	        ;;
 	-none)
 		;;
 	*)
@@ -1503,10 +1466,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-	score-*)
+        score-*)
 		os=-elf
 		;;
-	spu-*)
+        spu-*)
 		os=-elf
 		;;
 	*-acorn)
@@ -1518,17 +1481,8 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-	c4x-* | tic4x-*)
-		os=-coff
-		;;
-	tic54x-*)
-		os=-coff
-		;;
-	tic55x-*)
-		os=-coff
-		;;
-	tic6x-*)
-		os=-coff
+        c4x-* | tic4x-*)
+        	os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1555,7 +1509,7 @@ case $basic_machine in
 	m68*-cisco)
 		os=-aout
 		;;
-	mep-*)
+        mep-*)
 		os=-elf
 		;;
 	mips*-cisco)
@@ -1582,7 +1536,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-	*-knuth)
+    	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
index b4a3231..6f650ae 100755
--- a/build-aux/ltmain.sh
+++ b/build-aux/ltmain.sh
@@ -69,7 +69,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4 Debian-2.4-2ubuntu1
+#         $progname:	(GNU libtool) 2.4 Debian-2.4-2
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -79,7 +79,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4 Debian-2.4-2ubuntu1"
+VERSION="2.4 Debian-2.4-2"
 TIMESTAMP=""
 package_revision=1.3293
 
diff --git a/configure b/configure
index 1e09df1..2cb7b2d 100755
--- a/configure
+++ b/configure
@@ -11585,7 +11585,7 @@ fi
 
 done
 
-for ac_header in stdlib.h mntent.h linux/cdrom.h inttypes.h strings.h
+for ac_header in stdlib.h mntent.h linux/cdrom.h inttypes.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/configure.ac b/configure.ac
index b0d1b80..97b4a2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,7 @@ AC_TYPE_SIGNAL
 
 # required headers
 AC_CHECK_HEADERS([stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h])
-AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h inttypes.h strings.h])
+AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h inttypes.h])
 AC_CHECK_HEADERS([sys/time.h time.h])
 if test "${SYS}" != "mingw32" ; then
     AC_CHECK_HEADERS(pthread.h,, [AC_MSG_ERROR([pthread.h required])])
diff --git a/player_wrappers/xine/input_bluray.c b/player_wrappers/xine/input_bluray.c
index 5e0078d..4088b50 100644
--- a/player_wrappers/xine/input_bluray.c
+++ b/player_wrappers/xine/input_bluray.c
@@ -38,7 +38,6 @@
 #include <string.h>
 #include <errno.h>
 #include <dlfcn.h>
-#include <pthread.h>
 
 #include <libbluray/bluray.h>
 #include <libbluray/keys.h>
@@ -52,7 +51,7 @@
 
 #define LOGMSG(x...)  xine_log (this->stream->xine, XINE_LOG_MSG, "input_bluray: " x);
 
-#define XINE_ENGINE_INTERNAL  // stream->demux_plugin
+#define XINE_ENGINE_INTERNAL
 
 #ifdef HAVE_CONFIG_H
 # include "xine_internal.h"
@@ -118,8 +117,7 @@ typedef struct {
   int                num_titles;        /* navigation mode, number of titles in disc index */
   int                current_title;     /* navigation mode, title from disc index */
   BLURAY_TITLE_INFO *title_info;
-  pthread_mutex_t    title_info_mutex;  /* lock this when accessing title_info outside of input/demux thread */
-  unsigned int       current_clip;
+  int                current_clip;
   int                error;
   int                menu_open;
   int                pg_enable;
@@ -141,6 +139,8 @@ static void close_overlay(bluray_input_plugin_t *this)
 static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov)
 {
   bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
+  uint32_t color[256];
+  uint8_t  trans[256];
   unsigned i;
 
   if (!this) {
@@ -150,7 +150,7 @@ static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov)
   if (!ov || ov->plane == 1)
     this->menu_open = 0;
 
-  if (!ov) {
+  if (!ov || !ov->img) {
     /* hide OSD */
     close_overlay(this);
     return;
@@ -161,47 +161,31 @@ static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov)
   if (!this->osd) {
     this->osd = xine_osd_new(this->stream, 0, 0, 1920, 1080);
   }
-  if (!this->pg_enable) {
+  if (!this->pg_enable)
     _x_select_spu_channel(this->stream, -1);
-  }
 
   /* convert and set palette */
-  if (ov->palette) {
-    uint32_t color[256];
-    uint8_t  trans[256];
-    for(i = 0; i < 256; i++) {
-      trans[i] = ov->palette[i].T;
-      color[i] = (ov->palette[i].Y << 16) | (ov->palette[i].Cr << 8) | ov->palette[i].Cb;
-    }
 
-    xine_osd_set_palette(this->osd, color, trans);
+  for(i = 0; i < 256; i++) {
+    trans[i] = ov->palette[i].T;
+    color[i] = (ov->palette[i].Y << 16) | (ov->palette[i].Cr << 8) | ov->palette[i].Cb;
   }
 
-  /* uncompress and draw bitmap */
-  if (ov->img) {
-    const BD_PG_RLE_ELEM *rlep = ov->img;
-    uint8_t *img = malloc(ov->w * ov->h);
-    unsigned pixels = ov->w * ov->h;
-
-    for (i = 0; i < pixels; i += rlep->len, rlep++) {
-      memset(img + i, rlep->color, rlep->len);
-    }
+  xine_osd_set_palette(this->osd, color, trans);
 
-    xine_osd_draw_bitmap(this->osd, img, ov->x, ov->y, ov->w, ov->h, NULL);
+  /* uncompress and draw bitmap */
 
-    free(img);
+  const BD_PG_RLE_ELEM *rlep = ov->img;
+  uint8_t *img = malloc(ov->w * ov->h);
+  unsigned pixels = ov->w * ov->h;
 
-  } else {
+  for (i = 0; i < pixels; i += rlep->len, rlep++) {
+    memset(img + i, rlep->color, rlep->len);
+  }
 
-    if (ov->x == 0 && ov->y == 0 && ov->w == 1920 && ov->h == 1080) {
-      /* Nothing to display, close OSD */
-      close_overlay(this);
-      return;
-    }
+  xine_osd_draw_bitmap(this->osd, img, ov->x, ov->y, ov->w, ov->h, NULL);
 
-    /* wipe rect */
-    xine_osd_draw_rect(this->osd, ov->x, ov->y, ov->x + ov->w - 1, ov->y + ov->h - 1, 0xff, 1);
-  }
+  free(img);
 
   /* display */
 
@@ -213,29 +197,24 @@ static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov)
 
 static void update_stream_info(bluray_input_plugin_t *this)
 {
-  if (this->title_info) {
-    /* set stream info */
-    _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_COUNT,    this->title_info->angle_count);
-    _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER,   bd_get_current_angle(this->bdh));
-    _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_CHAPTERS,       this->title_info->chapter_count > 0);
-    _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_COUNT,  this->title_info->chapter_count);
-    _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER, bd_get_current_chapter(this->bdh) + 1);
-  }
+  /* set stream info */
+
+  _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_COUNT,    this->title_info->angle_count);
+  _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER,   bd_get_current_angle(this->bdh));
+  _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_CHAPTERS,       this->title_info->chapter_count > 0);
+  _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_COUNT,  this->title_info->chapter_count);
+  _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER, bd_get_current_chapter(this->bdh) + 1);
 }
 
 static void update_title_info(bluray_input_plugin_t *this, int playlist_id)
 {
-  pthread_mutex_lock(&this->title_info_mutex);
-
   if (this->title_info)
     bd_free_title_info(this->title_info);
 
   if (playlist_id < 0)
-    this->title_info = bd_get_title_info(this->bdh, this->current_title_idx, 0);
+    this->title_info = bd_get_title_info(this->bdh, this->current_title_idx);
   else
-    this->title_info = bd_get_playlist_info(this->bdh, playlist_id, 0);
-
-  pthread_mutex_unlock(&this->title_info_mutex);
+    this->title_info = bd_get_playlist_info(this->bdh, playlist_id);
 
   if (!this->title_info) {
     LOGMSG("bd_get_title_info(%d) failed\n", this->current_title_idx);
@@ -326,7 +305,7 @@ static void stream_reset(bluray_input_plugin_t *this)
 
   this->cap_seekable = 0;
 
-  _x_set_fine_speed(this->stream, XINE_FINE_SPEED_NORMAL);
+  xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, XINE_FINE_SPEED_NORMAL);
   this->stream->demux_plugin->seek(this->stream->demux_plugin, 0, 0, 1);
   _x_demux_control_start(this->stream);
 
@@ -354,7 +333,7 @@ static void wait_secs(bluray_input_plugin_t *this, unsigned seconds)
 
   // wait until interrupted
   int loops = seconds * 25; /* N * 40 ms */
-  while (!_x_action_pending(this->stream) && loops-- > 0) {
+  while (!this->stream->demux_action_pending && loops-- > 0) {
     xine_usec_sleep(40*1000);
   }
 
@@ -448,7 +427,10 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
 
       case BD_EVENT_PLAYITEM:
         lprintf("BD_EVENT_PLAYITEM %d\n", ev.param);
-        this->current_clip = ev.param;
+        if (ev.param < this->title_info->clip_count)
+          this->current_clip = ev.param;
+        else
+          this->current_clip = 0;
         break;
 
       case BD_EVENT_CHAPTER:
@@ -681,7 +663,7 @@ static off_t bluray_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
       if (result == 0) {
         handle_events(this);
         if (ev.event == BD_EVENT_NONE) {
-          if (_x_action_pending(this->stream)) {
+          if (this->stream->demux_action_pending) {
             break;
           }
         }
@@ -755,7 +737,7 @@ static off_t bluray_plugin_seek_time (input_plugin_t *this_gen, int time_offset,
 {
   bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
 
-  if (!this || !this->bdh)
+  if (!this || !this->bdh || !this->title_info)
     return -1;
 
   /* convert relative seeks to absolute */
@@ -764,21 +746,11 @@ static off_t bluray_plugin_seek_time (input_plugin_t *this_gen, int time_offset,
     time_offset += this_gen->get_current_time(this_gen);
   }
   else if (origin == SEEK_END) {
-
-    pthread_mutex_lock(&this->title_info_mutex);
-
-    if (!this->title_info) {
-      pthread_mutex_unlock(&this->title_info_mutex);
-      return -1;
-    }
-
     int duration = this->title_info->duration / 90;
     if (time_offset < duration)
       time_offset = duration - time_offset;
     else
       time_offset = 0;
-
-    pthread_mutex_unlock(&this->title_info_mutex);
   }
 
   lprintf("bluray_plugin_seek_time() seeking to %d.%03ds\n", time_offset / 1000, time_offset % 1000);
@@ -821,9 +793,12 @@ static const char* bluray_plugin_get_mrl (input_plugin_t *this_gen)
   return this->mrl;
 }
 
-static int get_optional_data_impl (bluray_input_plugin_t *this, void *data, int data_type)
+static int bluray_plugin_get_optional_data (input_plugin_t *this_gen, void *data, int data_type)
 {
-  unsigned int current_clip = this->current_clip;
+  bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
+
+  if (!this || !this->stream || !data)
+    return INPUT_OPTIONAL_UNSUPPORTED;
 
   switch (data_type) {
     case INPUT_OPTIONAL_DATA_DEMUXER:
@@ -835,9 +810,9 @@ static int get_optional_data_impl (bluray_input_plugin_t *this, void *data, int
      * - channel number can be mpeg-ts PID (0x1100 ... 0x11ff)
      */
     case INPUT_OPTIONAL_DATA_AUDIOLANG:
-      if (this->title_info && this->title_info->clip_count < current_clip) {
+      if (this->title_info) {
         int               channel = *((int *)data);
-        BLURAY_CLIP_INFO *clip    = &this->title_info->clips[current_clip];
+        BLURAY_CLIP_INFO *clip    = &this->title_info->clips[this->current_clip];
 
         if (channel >= 0 && channel < clip->audio_stream_count) {
           memcpy(data, clip->audio_streams[channel].lang, 4);
@@ -865,9 +840,9 @@ static int get_optional_data_impl (bluray_input_plugin_t *this, void *data, int
      * - channel number can be mpeg-ts PID (0x1200 ... 0x12ff)
      */
     case INPUT_OPTIONAL_DATA_SPULANG:
-      if (this->title_info && this->title_info->clip_count < current_clip) {
+      if (this->title_info) {
         int               channel = *((int *)data);
-        BLURAY_CLIP_INFO *clip    = &this->title_info->clips[current_clip];
+        BLURAY_CLIP_INFO *clip    = &this->title_info->clips[this->current_clip];
 
         if (channel >= 0 && channel < clip->pg_stream_count) {
           memcpy(data, clip->pg_streams[channel].lang, 4);
@@ -897,20 +872,6 @@ static int get_optional_data_impl (bluray_input_plugin_t *this, void *data, int
   return INPUT_OPTIONAL_UNSUPPORTED;
 }
 
-static int bluray_plugin_get_optional_data (input_plugin_t *this_gen, void *data, int data_type)
-{
-  bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
-  int r = INPUT_OPTIONAL_UNSUPPORTED;
-
-  if (this && this->stream && data) {
-    pthread_mutex_lock(&this->title_info_mutex);
-    r = get_optional_data_impl(this, data, data_type);
-    pthread_mutex_unlock(&this->title_info_mutex);
-  }
-
-  return r;
-}
-
 static void bluray_plugin_dispose (input_plugin_t *this_gen)
 {
   bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
@@ -923,13 +884,8 @@ static void bluray_plugin_dispose (input_plugin_t *this_gen)
   if (this->event_queue)
     xine_event_dispose_queue(this->event_queue);
 
-  pthread_mutex_lock(&this->title_info_mutex);
   if (this->title_info)
     bd_free_title_info(this->title_info);
-  this->title_info = NULL;
-  pthread_mutex_unlock(&this->title_info_mutex);
-
-  pthread_mutex_destroy(&this->title_info_mutex);
 
   if (this->bdh)
     bd_close(this->bdh);
@@ -1088,7 +1044,7 @@ static int bluray_plugin_open (input_plugin_t *this_gen)
 
   /* load title list */
 
-  this->num_title_idx = bd_get_titles(this->bdh, TITLES_RELEVANT, 180);
+  this->num_title_idx = bd_get_titles(this->bdh, TITLES_RELEVANT);
   LOGMSG("%d titles\n", this->num_title_idx);
 
   if (this->num_title_idx < 1)
@@ -1101,7 +1057,7 @@ static int bluray_plugin_open (input_plugin_t *this_gen)
     uint64_t duration = 0;
     int i, playlist = 99999;
     for (i = 0; i < this->num_title_idx; i++) {
-      BLURAY_TITLE_INFO *info = bd_get_title_info(this->bdh, i, 0);
+      BLURAY_TITLE_INFO *info = bd_get_title_info(this->bdh, i);
       if (info->duration > duration) {
         title    = i;
         duration = info->duration;
@@ -1210,8 +1166,6 @@ static input_plugin_t *bluray_class_get_instance (input_class_t *cls_gen, xine_s
 
   this->event_queue = xine_event_new_queue (this->stream);
 
-  pthread_mutex_init(&this->title_info_mutex, NULL);
-
   this->pg_stream = -1;
 
   return &this->input_plugin;
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 265bb31..bc7c348 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -14,6 +14,7 @@ noinst_PROGRAMS=bdsplice mpls_dump clpi_dump index_dump mobj_dump sound_dump \
     libbluray_test bd_info list_titles hdmv_test
 
 BLURAY_LIB = $(top_builddir)/src/libbluray.la
+BLURAY_LIB_STATIC = $(top_builddir)/src/.libs/libbluray.a
 
 if USING_BDJAVA
   AM_CFLAGS += @BDJAVA_CFLAGS@
@@ -25,39 +26,29 @@ bdsplice_SOURCES = \
 bdsplice_LDADD = $(BLURAY_LIB)
 
 mpls_dump_SOURCES = \
-	mpls_dump.c util.c util.h \
-	../util/strutl.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../file/dir_posix.c \
-	../libbluray/bdnav/mpls_parse.c \
-	../libbluray/bdnav/clpi_parse.c \
-	../libbluray/bdnav/navigation.c
+	mpls_dump.c util.c util.h ../util/strutl.c
+
+mpls_dump_LDADD = $(BLURAY_LIB_STATIC)
 
 clpi_dump_SOURCES = \
-	clpi_dump.c util.c util.h \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/clpi_parse.c
+	clpi_dump.c util.c util.h
+
+clpi_dump_LDADD = $(BLURAY_LIB_STATIC)
 
 sound_dump_SOURCES = \
-	sound_dump.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/sound_parse.c
+	sound_dump.c
+
+sound_dump_LDADD = $(BLURAY_LIB_STATIC)
 
 index_dump_SOURCES = \
-	index_dump.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/index_parse.c
+	index_dump.c
+
+index_dump_LDADD = $(BLURAY_LIB_STATIC)
 
 mobj_dump_SOURCES = \
-	mobj_dump.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/hdmv/mobj_parse.c \
-	../libbluray/hdmv/mobj_print.c
+	mobj_dump.c
+
+mobj_dump_LDADD = $(BLURAY_LIB_STATIC)
 
 libbluray_test_SOURCES = \
 	libbluray_test.c ../util/logging.c
diff --git a/src/examples/Makefile.in b/src/examples/Makefile.in
index 2d12d75..2cab51e 100644
--- a/src/examples/Makefile.in
+++ b/src/examples/Makefile.in
@@ -75,25 +75,19 @@ am__bdsplice_SOURCES_DIST = bdsplice.c
 @USING_EXAMPLES_TRUE at am_bdsplice_OBJECTS = bdsplice.$(OBJEXT)
 bdsplice_OBJECTS = $(am_bdsplice_OBJECTS)
 @USING_EXAMPLES_TRUE at bdsplice_DEPENDENCIES = $(BLURAY_LIB)
-am__clpi_dump_SOURCES_DIST = clpi_dump.c util.c util.h \
-	../util/logging.c ../file/file_posix.c \
-	../libbluray/bdnav/clpi_parse.c
+am__clpi_dump_SOURCES_DIST = clpi_dump.c util.c util.h
 @USING_EXAMPLES_TRUE at am_clpi_dump_OBJECTS = clpi_dump.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	util.$(OBJEXT) logging.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	file_posix.$(OBJEXT) clpi_parse.$(OBJEXT)
+ at USING_EXAMPLES_TRUE@	util.$(OBJEXT)
 clpi_dump_OBJECTS = $(am_clpi_dump_OBJECTS)
-clpi_dump_LDADD = $(LDADD)
+ at USING_EXAMPLES_TRUE@clpi_dump_DEPENDENCIES = $(BLURAY_LIB_STATIC)
 am__hdmv_test_SOURCES_DIST = hdmv_test.c
 @USING_EXAMPLES_TRUE at am_hdmv_test_OBJECTS = hdmv_test.$(OBJEXT)
 hdmv_test_OBJECTS = $(am_hdmv_test_OBJECTS)
 @USING_EXAMPLES_TRUE at hdmv_test_DEPENDENCIES = $(BLURAY_LIB)
-am__index_dump_SOURCES_DIST = index_dump.c ../util/logging.c \
-	../file/file_posix.c ../libbluray/bdnav/index_parse.c
- at USING_EXAMPLES_TRUE@am_index_dump_OBJECTS = index_dump.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	logging.$(OBJEXT) file_posix.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	index_parse.$(OBJEXT)
+am__index_dump_SOURCES_DIST = index_dump.c
+ at USING_EXAMPLES_TRUE@am_index_dump_OBJECTS = index_dump.$(OBJEXT)
 index_dump_OBJECTS = $(am_index_dump_OBJECTS)
-index_dump_LDADD = $(LDADD)
+ at USING_EXAMPLES_TRUE@index_dump_DEPENDENCIES = $(BLURAY_LIB_STATIC)
 am__libbluray_test_SOURCES_DIST = libbluray_test.c ../util/logging.c
 @USING_EXAMPLES_TRUE at am_libbluray_test_OBJECTS =  \
 @USING_EXAMPLES_TRUE@	libbluray_test.$(OBJEXT) \
@@ -105,33 +99,20 @@ am__list_titles_SOURCES_DIST = list_titles.c ../util/logging.c
 @USING_EXAMPLES_TRUE@	logging.$(OBJEXT)
 list_titles_OBJECTS = $(am_list_titles_OBJECTS)
 @USING_EXAMPLES_TRUE at list_titles_DEPENDENCIES = $(BLURAY_LIB)
-am__mobj_dump_SOURCES_DIST = mobj_dump.c ../util/logging.c \
-	../file/file_posix.c ../libbluray/hdmv/mobj_parse.c \
-	../libbluray/hdmv/mobj_print.c
- at USING_EXAMPLES_TRUE@am_mobj_dump_OBJECTS = mobj_dump.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	logging.$(OBJEXT) file_posix.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	mobj_parse.$(OBJEXT) mobj_print.$(OBJEXT)
+am__mobj_dump_SOURCES_DIST = mobj_dump.c
+ at USING_EXAMPLES_TRUE@am_mobj_dump_OBJECTS = mobj_dump.$(OBJEXT)
 mobj_dump_OBJECTS = $(am_mobj_dump_OBJECTS)
-mobj_dump_LDADD = $(LDADD)
+ at USING_EXAMPLES_TRUE@mobj_dump_DEPENDENCIES = $(BLURAY_LIB_STATIC)
 am__mpls_dump_SOURCES_DIST = mpls_dump.c util.c util.h \
-	../util/strutl.c ../util/logging.c ../file/file_posix.c \
-	../file/dir_posix.c ../libbluray/bdnav/mpls_parse.c \
-	../libbluray/bdnav/clpi_parse.c \
-	../libbluray/bdnav/navigation.c
+	../util/strutl.c
 @USING_EXAMPLES_TRUE at am_mpls_dump_OBJECTS = mpls_dump.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	util.$(OBJEXT) strutl.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	logging.$(OBJEXT) file_posix.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	dir_posix.$(OBJEXT) mpls_parse.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	clpi_parse.$(OBJEXT) navigation.$(OBJEXT)
+ at USING_EXAMPLES_TRUE@	util.$(OBJEXT) strutl.$(OBJEXT)
 mpls_dump_OBJECTS = $(am_mpls_dump_OBJECTS)
-mpls_dump_LDADD = $(LDADD)
-am__sound_dump_SOURCES_DIST = sound_dump.c ../util/logging.c \
-	../file/file_posix.c ../libbluray/bdnav/sound_parse.c
- at USING_EXAMPLES_TRUE@am_sound_dump_OBJECTS = sound_dump.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	logging.$(OBJEXT) file_posix.$(OBJEXT) \
- at USING_EXAMPLES_TRUE@	sound_parse.$(OBJEXT)
+ at USING_EXAMPLES_TRUE@mpls_dump_DEPENDENCIES = $(BLURAY_LIB_STATIC)
+am__sound_dump_SOURCES_DIST = sound_dump.c
+ at USING_EXAMPLES_TRUE@am_sound_dump_OBJECTS = sound_dump.$(OBJEXT)
 sound_dump_OBJECTS = $(am_sound_dump_OBJECTS)
-sound_dump_LDADD = $(LDADD)
+ at USING_EXAMPLES_TRUE@sound_dump_DEPENDENCIES = $(BLURAY_LIB_STATIC)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
 am__depfiles_maybe = depfiles
@@ -318,45 +299,31 @@ AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_WARNINGS) \
 	$(SET_OPTIMIZATIONS) $(SET_DEBUG_OPTS) $(SET_INCLUDES) \
 	$(am__append_1)
 @USING_EXAMPLES_TRUE at BLURAY_LIB = $(top_builddir)/src/libbluray.la
+ at USING_EXAMPLES_TRUE@BLURAY_LIB_STATIC = $(top_builddir)/src/.libs/libbluray.a
 @USING_EXAMPLES_TRUE at bdsplice_SOURCES = \
 @USING_EXAMPLES_TRUE@	bdsplice.c
 
 @USING_EXAMPLES_TRUE at bdsplice_LDADD = $(BLURAY_LIB)
 @USING_EXAMPLES_TRUE at mpls_dump_SOURCES = \
- at USING_EXAMPLES_TRUE@	mpls_dump.c util.c util.h \
- at USING_EXAMPLES_TRUE@	../util/strutl.c \
- at USING_EXAMPLES_TRUE@	../util/logging.c \
- at USING_EXAMPLES_TRUE@	../file/file_posix.c \
- at USING_EXAMPLES_TRUE@	../file/dir_posix.c \
- at USING_EXAMPLES_TRUE@	../libbluray/bdnav/mpls_parse.c \
- at USING_EXAMPLES_TRUE@	../libbluray/bdnav/clpi_parse.c \
- at USING_EXAMPLES_TRUE@	../libbluray/bdnav/navigation.c
+ at USING_EXAMPLES_TRUE@	mpls_dump.c util.c util.h ../util/strutl.c
 
+ at USING_EXAMPLES_TRUE@mpls_dump_LDADD = $(BLURAY_LIB_STATIC)
 @USING_EXAMPLES_TRUE at clpi_dump_SOURCES = \
- at USING_EXAMPLES_TRUE@	clpi_dump.c util.c util.h \
- at USING_EXAMPLES_TRUE@	../util/logging.c \
- at USING_EXAMPLES_TRUE@	../file/file_posix.c \
- at USING_EXAMPLES_TRUE@	../libbluray/bdnav/clpi_parse.c
+ at USING_EXAMPLES_TRUE@	clpi_dump.c util.c util.h
 
+ at USING_EXAMPLES_TRUE@clpi_dump_LDADD = $(BLURAY_LIB_STATIC)
 @USING_EXAMPLES_TRUE at sound_dump_SOURCES = \
- at USING_EXAMPLES_TRUE@	sound_dump.c \
- at USING_EXAMPLES_TRUE@	../util/logging.c \
- at USING_EXAMPLES_TRUE@	../file/file_posix.c \
- at USING_EXAMPLES_TRUE@	../libbluray/bdnav/sound_parse.c
+ at USING_EXAMPLES_TRUE@	sound_dump.c
 
+ at USING_EXAMPLES_TRUE@sound_dump_LDADD = $(BLURAY_LIB_STATIC)
 @USING_EXAMPLES_TRUE at index_dump_SOURCES = \
- at USING_EXAMPLES_TRUE@	index_dump.c \
- at USING_EXAMPLES_TRUE@	../util/logging.c \
- at USING_EXAMPLES_TRUE@	../file/file_posix.c \
- at USING_EXAMPLES_TRUE@	../libbluray/bdnav/index_parse.c
+ at USING_EXAMPLES_TRUE@	index_dump.c
 
+ at USING_EXAMPLES_TRUE@index_dump_LDADD = $(BLURAY_LIB_STATIC)
 @USING_EXAMPLES_TRUE at mobj_dump_SOURCES = \
- at USING_EXAMPLES_TRUE@	mobj_dump.c \
- at USING_EXAMPLES_TRUE@	../util/logging.c \
- at USING_EXAMPLES_TRUE@	../file/file_posix.c \
- at USING_EXAMPLES_TRUE@	../libbluray/hdmv/mobj_parse.c \
- at USING_EXAMPLES_TRUE@	../libbluray/hdmv/mobj_print.c
+ at USING_EXAMPLES_TRUE@	mobj_dump.c
 
+ at USING_EXAMPLES_TRUE@mobj_dump_LDADD = $(BLURAY_LIB_STATIC)
 @USING_EXAMPLES_TRUE at libbluray_test_SOURCES = \
 @USING_EXAMPLES_TRUE@	libbluray_test.c ../util/logging.c
 
@@ -462,23 +429,14 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bdj_test.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bdsplice.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/clpi_dump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/clpi_parse.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dir_posix.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_posix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdmv_test.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_dump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_parse.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbluray_test.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list_titles.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/logging.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mobj_dump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mobj_parse.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mobj_print.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpls_dump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpls_parse.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/navigation.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sound_dump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sound_parse.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/strutl.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/util.Po at am__quote@
 
@@ -517,76 +475,6 @@ logging.obj: ../util/logging.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o logging.obj `if test -f '../util/logging.c'; then $(CYGPATH_W) '../util/logging.c'; else $(CYGPATH_W) '$(srcdir)/../util/logging.c'; fi`
 
-file_posix.o: ../file/file_posix.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file_posix.o -MD -MP -MF $(DEPDIR)/file_posix.Tpo -c -o file_posix.o `test -f '../file/file_posix.c' || echo '$(srcdir)/'`../file/file_posix.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/file_posix.Tpo $(DEPDIR)/file_posix.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../file/file_posix.c' object='file_posix.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file_posix.o `test -f '../file/file_posix.c' || echo '$(srcdir)/'`../file/file_posix.c
-
-file_posix.obj: ../file/file_posix.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file_posix.obj -MD -MP -MF $(DEPDIR)/file_posix.Tpo -c -o file_posix.obj `if test -f '../file/file_posix.c'; then $(CYGPATH_W) '../file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/../file/file_posix.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/file_posix.Tpo $(DEPDIR)/file_posix.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../file/file_posix.c' object='file_posix.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file_posix.obj `if test -f '../file/file_posix.c'; then $(CYGPATH_W) '../file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/../file/file_posix.c'; fi`
-
-clpi_parse.o: ../libbluray/bdnav/clpi_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT clpi_parse.o -MD -MP -MF $(DEPDIR)/clpi_parse.Tpo -c -o clpi_parse.o `test -f '../libbluray/bdnav/clpi_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/clpi_parse.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/clpi_parse.Tpo $(DEPDIR)/clpi_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/clpi_parse.c' object='clpi_parse.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o clpi_parse.o `test -f '../libbluray/bdnav/clpi_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/clpi_parse.c
-
-clpi_parse.obj: ../libbluray/bdnav/clpi_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT clpi_parse.obj -MD -MP -MF $(DEPDIR)/clpi_parse.Tpo -c -o clpi_parse.obj `if test -f '../libbluray/bdnav/clpi_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/clpi_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/clpi_parse.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/clpi_parse.Tpo $(DEPDIR)/clpi_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/clpi_parse.c' object='clpi_parse.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o clpi_parse.obj `if test -f '../libbluray/bdnav/clpi_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/clpi_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/clpi_parse.c'; fi`
-
-index_parse.o: ../libbluray/bdnav/index_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT index_parse.o -MD -MP -MF $(DEPDIR)/index_parse.Tpo -c -o index_parse.o `test -f '../libbluray/bdnav/index_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/index_parse.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/index_parse.Tpo $(DEPDIR)/index_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/index_parse.c' object='index_parse.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o index_parse.o `test -f '../libbluray/bdnav/index_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/index_parse.c
-
-index_parse.obj: ../libbluray/bdnav/index_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT index_parse.obj -MD -MP -MF $(DEPDIR)/index_parse.Tpo -c -o index_parse.obj `if test -f '../libbluray/bdnav/index_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/index_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/index_parse.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/index_parse.Tpo $(DEPDIR)/index_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/index_parse.c' object='index_parse.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o index_parse.obj `if test -f '../libbluray/bdnav/index_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/index_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/index_parse.c'; fi`
-
-mobj_parse.o: ../libbluray/hdmv/mobj_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mobj_parse.o -MD -MP -MF $(DEPDIR)/mobj_parse.Tpo -c -o mobj_parse.o `test -f '../libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`../libbluray/hdmv/mobj_parse.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mobj_parse.Tpo $(DEPDIR)/mobj_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/hdmv/mobj_parse.c' object='mobj_parse.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mobj_parse.o `test -f '../libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`../libbluray/hdmv/mobj_parse.c
-
-mobj_parse.obj: ../libbluray/hdmv/mobj_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mobj_parse.obj -MD -MP -MF $(DEPDIR)/mobj_parse.Tpo -c -o mobj_parse.obj `if test -f '../libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) '../libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/hdmv/mobj_parse.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mobj_parse.Tpo $(DEPDIR)/mobj_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/hdmv/mobj_parse.c' object='mobj_parse.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mobj_parse.obj `if test -f '../libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) '../libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/hdmv/mobj_parse.c'; fi`
-
-mobj_print.o: ../libbluray/hdmv/mobj_print.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mobj_print.o -MD -MP -MF $(DEPDIR)/mobj_print.Tpo -c -o mobj_print.o `test -f '../libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`../libbluray/hdmv/mobj_print.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mobj_print.Tpo $(DEPDIR)/mobj_print.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/hdmv/mobj_print.c' object='mobj_print.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mobj_print.o `test -f '../libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`../libbluray/hdmv/mobj_print.c
-
-mobj_print.obj: ../libbluray/hdmv/mobj_print.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mobj_print.obj -MD -MP -MF $(DEPDIR)/mobj_print.Tpo -c -o mobj_print.obj `if test -f '../libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) '../libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/hdmv/mobj_print.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mobj_print.Tpo $(DEPDIR)/mobj_print.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/hdmv/mobj_print.c' object='mobj_print.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mobj_print.obj `if test -f '../libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) '../libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/hdmv/mobj_print.c'; fi`
-
 strutl.o: ../util/strutl.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strutl.o -MD -MP -MF $(DEPDIR)/strutl.Tpo -c -o strutl.o `test -f '../util/strutl.c' || echo '$(srcdir)/'`../util/strutl.c
 @am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/strutl.Tpo $(DEPDIR)/strutl.Po
@@ -601,62 +489,6 @@ strutl.obj: ../util/strutl.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutl.obj `if test -f '../util/strutl.c'; then $(CYGPATH_W) '../util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/../util/strutl.c'; fi`
 
-dir_posix.o: ../file/dir_posix.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir_posix.o -MD -MP -MF $(DEPDIR)/dir_posix.Tpo -c -o dir_posix.o `test -f '../file/dir_posix.c' || echo '$(srcdir)/'`../file/dir_posix.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dir_posix.Tpo $(DEPDIR)/dir_posix.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../file/dir_posix.c' object='dir_posix.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir_posix.o `test -f '../file/dir_posix.c' || echo '$(srcdir)/'`../file/dir_posix.c
-
-dir_posix.obj: ../file/dir_posix.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir_posix.obj -MD -MP -MF $(DEPDIR)/dir_posix.Tpo -c -o dir_posix.obj `if test -f '../file/dir_posix.c'; then $(CYGPATH_W) '../file/dir_posix.c'; else $(CYGPATH_W) '$(srcdir)/../file/dir_posix.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dir_posix.Tpo $(DEPDIR)/dir_posix.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../file/dir_posix.c' object='dir_posix.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir_posix.obj `if test -f '../file/dir_posix.c'; then $(CYGPATH_W) '../file/dir_posix.c'; else $(CYGPATH_W) '$(srcdir)/../file/dir_posix.c'; fi`
-
-mpls_parse.o: ../libbluray/bdnav/mpls_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mpls_parse.o -MD -MP -MF $(DEPDIR)/mpls_parse.Tpo -c -o mpls_parse.o `test -f '../libbluray/bdnav/mpls_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/mpls_parse.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mpls_parse.Tpo $(DEPDIR)/mpls_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/mpls_parse.c' object='mpls_parse.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mpls_parse.o `test -f '../libbluray/bdnav/mpls_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/mpls_parse.c
-
-mpls_parse.obj: ../libbluray/bdnav/mpls_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mpls_parse.obj -MD -MP -MF $(DEPDIR)/mpls_parse.Tpo -c -o mpls_parse.obj `if test -f '../libbluray/bdnav/mpls_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/mpls_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/mpls_parse.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mpls_parse.Tpo $(DEPDIR)/mpls_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/mpls_parse.c' object='mpls_parse.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mpls_parse.obj `if test -f '../libbluray/bdnav/mpls_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/mpls_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/mpls_parse.c'; fi`
-
-navigation.o: ../libbluray/bdnav/navigation.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT navigation.o -MD -MP -MF $(DEPDIR)/navigation.Tpo -c -o navigation.o `test -f '../libbluray/bdnav/navigation.c' || echo '$(srcdir)/'`../libbluray/bdnav/navigation.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/navigation.Tpo $(DEPDIR)/navigation.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/navigation.c' object='navigation.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o navigation.o `test -f '../libbluray/bdnav/navigation.c' || echo '$(srcdir)/'`../libbluray/bdnav/navigation.c
-
-navigation.obj: ../libbluray/bdnav/navigation.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT navigation.obj -MD -MP -MF $(DEPDIR)/navigation.Tpo -c -o navigation.obj `if test -f '../libbluray/bdnav/navigation.c'; then $(CYGPATH_W) '../libbluray/bdnav/navigation.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/navigation.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/navigation.Tpo $(DEPDIR)/navigation.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/navigation.c' object='navigation.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o navigation.obj `if test -f '../libbluray/bdnav/navigation.c'; then $(CYGPATH_W) '../libbluray/bdnav/navigation.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/navigation.c'; fi`
-
-sound_parse.o: ../libbluray/bdnav/sound_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sound_parse.o -MD -MP -MF $(DEPDIR)/sound_parse.Tpo -c -o sound_parse.o `test -f '../libbluray/bdnav/sound_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/sound_parse.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/sound_parse.Tpo $(DEPDIR)/sound_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/sound_parse.c' object='sound_parse.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sound_parse.o `test -f '../libbluray/bdnav/sound_parse.c' || echo '$(srcdir)/'`../libbluray/bdnav/sound_parse.c
-
-sound_parse.obj: ../libbluray/bdnav/sound_parse.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sound_parse.obj -MD -MP -MF $(DEPDIR)/sound_parse.Tpo -c -o sound_parse.obj `if test -f '../libbluray/bdnav/sound_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/sound_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/sound_parse.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/sound_parse.Tpo $(DEPDIR)/sound_parse.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../libbluray/bdnav/sound_parse.c' object='sound_parse.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sound_parse.obj `if test -f '../libbluray/bdnav/sound_parse.c'; then $(CYGPATH_W) '../libbluray/bdnav/sound_parse.c'; else $(CYGPATH_W) '$(srcdir)/../libbluray/bdnav/sound_parse.c'; fi`
-
 mostlyclean-libtool:
 	-rm -f *.lo
 
diff --git a/src/examples/bdj_test.c b/src/examples/bdj_test.c
index bb8a46f..dedd8b2 100644
--- a/src/examples/bdj_test.c
+++ b/src/examples/bdj_test.c
@@ -36,28 +36,23 @@ void usage(void) {
     printf("Usage: [path to disc] [starting object]\n");
 }
 
-int main(int argc, char** argv)
-{
+int main(int argc, char** argv) {
+    printf("%s %s\n", argv[1], argv[2]);
     if (argc < 3) {
         usage();
         return 0;
     }
 
-    printf("%s %s\n", argv[1], argv[2]);
-
     BLURAY* bd = bd_open(argv[1], NULL);
 
-    bd_get_titles(bd, TITLES_ALL, 0);
+    bd_get_titles(bd, TITLES_ALL);
     bd_select_title(bd, 1);
 
-    if (!bd_start_bdj(bd, argv[2])) {
+    if (bd_start_bdj(bd, argv[2]))
         printf("Failed to start BD-J application.\n");
-    } else {
+    else {
         while (1) { sleep(20); }
         bd_stop_bdj(bd);
     }
-
-    bd_close(bd);
-
     return 0;
 }
diff --git a/src/examples/bdsplice.c b/src/examples/bdsplice.c
index 4d61b06..d654541 100644
--- a/src/examples/bdsplice.c
+++ b/src/examples/bdsplice.c
@@ -141,7 +141,7 @@ main(int argc, char *argv[])
         return 1;
     }
 
-    title_count = bd_get_titles(bd, TITLES_RELEVANT, 0);
+    title_count = bd_get_titles(bd, TITLES_RELEVANT);
     if (title_count <= 0) {
         fprintf(stderr, "No titles found: %s\n", bdpath);
         return 1;
@@ -162,7 +162,7 @@ main(int argc, char *argv[])
         out = stdout;
     }
 
-    ti = bd_get_title_info(bd, title_no, angle);
+    ti = bd_get_title_info(bd, title_no);
 
     if (angle >= (int)ti->angle_count) {
         fprintf(stderr, "Invalid angle %d > angle count %d. Using angle 1.\n", 
diff --git a/src/examples/hdmv_test.c b/src/examples/hdmv_test.c
index fb542ba..c0037e7 100644
--- a/src/examples/hdmv_test.c
+++ b/src/examples/hdmv_test.c
@@ -58,18 +58,6 @@ static void _print_event(BD_EVENT *ev)
             printf("EVENT_STILL:\t%d\n", ev->param);
             break;
 
-        case BD_EVENT_SEEK:
-            printf("EVENT_SEEK:\t%d\n", ev->param);
-            break;
-
-        case BD_EVENT_STILL_TIME:
-            if (ev->param) {
-                printf("EVENT_STILL_TIME:\t%d\n", ev->param);
-            } else {
-                printf("EVENT_STILL_TIME:\tinfinite\n");
-            }
-            break;
-
         /* stream selection */
 
         case BD_EVENT_AUDIO_STREAM:
@@ -101,9 +89,10 @@ static void _print_event(BD_EVENT *ev)
             printf("EVENT_SECONDARY_VIDEO_SIZE:\t%s\n", ev->param==0 ? "PIP" : "fullscreen");
             break;
 
+
         default:
-            printf("UNKNOWN EVENT %d:\t%d\n", ev->event, ev->param);
-            break;
+          printf("UNKNOWN EVENT %d:\t%d\n", ev->event, ev->param);
+          break;
       }
 
       fflush(stdout);
diff --git a/src/examples/libbluray_test.c b/src/examples/libbluray_test.c
index 47e3014..646d822 100644
--- a/src/examples/libbluray_test.c
+++ b/src/examples/libbluray_test.c
@@ -41,11 +41,11 @@ int main(int argc, char *argv[])
 
     BD_DEBUG(DBG_BLURAY,"\nListing titles:\n");
 
-    count = bd_get_titles(bd, TITLES_RELEVANT, 0);
+    count = bd_get_titles(bd, TITLES_RELEVANT);
     for (ii = 0; ii < count; ii++)
     {
         BLURAY_TITLE_INFO* ti;
-        ti = bd_get_title_info(bd, ii, 0);
+        ti = bd_get_title_info(bd, ii);
         BD_DEBUG(DBG_BLURAY,
        "index: %d duration: %02"PRIu64":%02"PRIu64":%02"PRIu64" chapters: %d\n",
               ii,
diff --git a/src/examples/list_titles.c b/src/examples/list_titles.c
index a987951..3f91f74 100644
--- a/src/examples/list_titles.c
+++ b/src/examples/list_titles.c
@@ -81,11 +81,15 @@ int main(int argc, char *argv[])
     }
     bd = bd_open(bd_dir, NULL);
 
-    count = bd_get_titles(bd, TITLES_RELEVANT, seconds);
+    count = bd_get_titles(bd, TITLES_RELEVANT);
     for (ii = 0; ii < count; ii++)
     {
         BLURAY_TITLE_INFO* ti;
-        ti = bd_get_title_info(bd, ii, 0);
+        ti = bd_get_title_info(bd, ii);
+        if (ti->duration / 90000 < seconds)
+        {
+            continue;
+        }
         printf(
        "index: %d duration: %02"PRIu64":%02"PRIu64":%02"PRIu64" chapters: %d angles: %u clips %u\n",
               ii + 1,
diff --git a/src/examples/mpls_dump.c b/src/examples/mpls_dump.c
index e1206e8..d9ed8d8 100644
--- a/src/examples/mpls_dump.c
+++ b/src/examples/mpls_dump.c
@@ -215,12 +215,6 @@ _show_details(MPLS_PL *pl, int level)
                         pi->connection_condition);
         indent_printf(level+1, "In-Time: %d", pi->in_time);
         indent_printf(level+1, "Out-Time: %d", pi->out_time);
-        if (pi->still_mode == 1) {
-            indent_printf(level+1, "Still time: %ds\n", pi->still_time);
-        }
-        if (pi->still_mode == 2) {
-            indent_printf(level+1, "Still time: infinite\n");
-        }
         if (pi->angle_count > 1) {
             for (jj = 1; jj < pi->angle_count; jj++) {
                 indent_printf(level+1, "Angle %d:", jj);
diff --git a/src/file/filesystem.h b/src/file/filesystem.h
index 5c2b9ce..4e707a2 100644
--- a/src/file/filesystem.h
+++ b/src/file/filesystem.h
@@ -21,10 +21,6 @@
 #ifndef BD_FILESYSTEM_H_
 #define BD_FILESYSTEM_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <stdint.h>
 
 /*
@@ -82,8 +78,5 @@ BD_FILE_OPEN bd_register_file(BD_FILE_OPEN p);
  */
 BD_DIR_OPEN bd_register_dir(BD_DIR_OPEN p);
 
-#ifdef __cplusplus
-};
-#endif
 
 #endif /* BD_FILESYSTEM_H_ */
diff --git a/src/libbluray/bdj/bdj_util.c b/src/libbluray/bdj/bdj_util.c
index 5bf4560..a4e4b24 100644
--- a/src/libbluray/bdj/bdj_util.c
+++ b/src/libbluray/bdj/bdj_util.c
@@ -1,6 +1,3 @@
-
-#include "util/logging.h"
-
 #include "bdj_util.h"
 
 jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...)
@@ -8,11 +5,6 @@ jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...)
     jclass obj_class = (*env)->FindClass(env, name);
     jmethodID obj_constructor = (*env)->GetMethodID(env, obj_class, "<init>", sig);
 
-    if (!obj_class) {
-        BD_DEBUG(DBG_BDJ | DBG_CRIT, "Class %s not found\n", name);
-        return NULL;
-    }
-
     va_list ap;
     va_start(ap, sig);
     jobject obj = (*env)->NewObjectV(env, obj_class, obj_constructor, ap);
diff --git a/src/libbluray/bdj/bdjo_parser.c b/src/libbluray/bdj/bdjo_parser.c
index 052e9e2..94effb9 100644
--- a/src/libbluray/bdj/bdjo_parser.c
+++ b/src/libbluray/bdj/bdjo_parser.c
@@ -395,9 +395,7 @@ static jobject _parse_bdjo(JNIEnv* env, BITBUFFER* buf)
 
 jobject bdjo_read(JNIEnv* env, const char* file)
 {
-    jobject    result = NULL;
     BD_FILE_H *handle = file_open(file, "rb");
-
     if (handle == NULL) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to open bdjo file (%s)\n", file);
         return NULL;
@@ -406,31 +404,26 @@ jobject bdjo_read(JNIEnv* env, const char* file)
     file_seek(handle, 0, SEEK_END);
     int64_t length = file_tell(handle);
 
-    if (length <= 0) {
-        BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", file);
-
-    } else {
+    if (length > 0) {
         file_seek(handle, 0, SEEK_SET);
 
         uint8_t *data = malloc(length);
         int64_t size_read = file_read(handle, data, length);
-
         if (size_read < length) {
-            BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", file);
+            free(data);
+            return NULL;
+        }
 
-        } else {
-            BITBUFFER *buf = malloc(sizeof(BITBUFFER));
-            bb_init(buf, data, length);
+        BITBUFFER* buf = malloc(sizeof(BITBUFFER));
+        bb_init(buf, data, length);
 
-            result = _parse_bdjo(env, buf);
+        jobject result = _parse_bdjo(env, buf);
 
-            free(buf);
-        }
+        free(buf);
+        file_close(handle);
 
-        free(data);
+        return result;
+    } else {
+        return NULL;
     }
-
-    file_close(handle);
-
-    return result;
 }
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index a85838c..b441a25 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -81,7 +81,7 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getTitleInfoN
 {
     BDJAVA* bdj = (BDJAVA*)np;
 
-    BLURAY_TITLE_INFO* ti = bd_get_title_info(bdj->bd, title, 0);
+    BLURAY_TITLE_INFO* ti = bd_get_title_info(bdj->bd, title);
     if (!ti)
         return NULL;
 
@@ -96,7 +96,7 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getPlaylistInfoN
   (JNIEnv * env, jclass cls, jlong np, jint playlist)
 {
     BDJAVA* bdj = (BDJAVA*)np;
-    BLURAY_TITLE_INFO* ti = bd_get_playlist_info(bdj->bd, playlist, 0);
+    BLURAY_TITLE_INFO* ti = bd_get_playlist_info(bdj->bd, playlist);
     if (!ti)
         return NULL;
 
@@ -110,7 +110,7 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getPlaylistInfoN
 JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getTitlesN(JNIEnv * env,
         jclass cls, jlong np, jchar flags) {
     BDJAVA* bdj = (BDJAVA*) np;
-    return bd_get_titles(bdj->bd, flags, 0);
+    return bd_get_titles(bdj->bd, flags);
 }
 
 JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekN(JNIEnv * env,
diff --git a/src/libbluray/bdnav/meta_parse.c b/src/libbluray/bdnav/meta_parse.c
index 24b4219..c6ffeff 100644
--- a/src/libbluray/bdnav/meta_parse.c
+++ b/src/libbluray/bdnav/meta_parse.c
@@ -31,11 +31,8 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-
-#ifdef HAVE_STRINGS_H
 #include <strings.h>
-#endif
+#include <errno.h>
 
 #ifdef HAVE_LIBXML2
 #include <libxml/parser.h>
@@ -117,7 +114,6 @@ static void _findMetaXMLfiles(META_ROOT *meta, const char *device_path)
             meta->dl_entries[i].filename = str_printf("%s", ent.d_name);
             strncpy(meta->dl_entries[i].language_code, ent.d_name+5,3);
             meta->dl_entries[i].language_code[3] = '\0';
-            str_tolower(meta->dl_entries[i].language_code);
         }
     }
     dir_close(dir);
@@ -191,7 +187,7 @@ META_DL *meta_get(META_ROOT *meta_root, const char *language_code)
 
     if (language_code) {
         for (i = 0; i < meta_root->dl_count; i++) {
-            if (strcmp(language_code, meta_root->dl_entries[i].language_code) == 0) {
+            if (strcasecmp(language_code, meta_root->dl_entries[i].language_code) == 0) {
                 return &meta_root->dl_entries[i];
             }
         }
@@ -199,7 +195,7 @@ META_DL *meta_get(META_ROOT *meta_root, const char *language_code)
     }
 
     for (i = 0; i < meta_root->dl_count; i++) {
-        if (strcmp(DEFAULT_LANGUAGE, meta_root->dl_entries[i].language_code) == 0) {
+        if (strcasecmp(DEFAULT_LANGUAGE, meta_root->dl_entries[i].language_code) == 0) {
             BD_DEBUG(DBG_DIR, "using default disclib language '"DEFAULT_LANGUAGE"'\n");
             return &meta_root->dl_entries[i];
         }
diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
index bce26a7..1f6895a 100644
--- a/src/libbluray/bdnav/navigation.c
+++ b/src/libbluray/bdnav/navigation.c
@@ -40,9 +40,6 @@ static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl)
         if (pl->list_count != pl_list[ii]->list_count) {
             continue;
         }
-        if (pl->mark_count != pl_list[ii]->mark_count) {
-            continue;
-        }
         for (jj = 0; jj < pl->list_count; jj++) {
             MPLS_PI *pi1, *pi2;
 
@@ -111,7 +108,7 @@ _pl_duration(MPLS_PL *pl)
     return duration;
 }
 
-NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags, uint32_t min_title_length)
+NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags)
 {
     BD_DIR_H *dir;
     BD_DIRENT ent;
@@ -133,7 +130,6 @@ NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags, uint32_t mi
     if (dir == NULL) {
         BD_DEBUG(DBG_NAV, "Failed to open dir: %s\n", path);
         X_FREE(path);
-        X_FREE(title_list->title_info);
         X_FREE(title_list);
         return NULL;
     }
@@ -171,11 +167,6 @@ NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags, uint32_t mi
                 mpls_free(pl);
                 continue;
             }
-            if (min_title_length > 0 &&
-                _pl_duration(pl) < min_title_length*45000) {
-                mpls_free(pl);
-                continue;
-            }
             if (ii >= title_info_alloc) {
                 NAV_TITLE_INFO *tmp = NULL;
                 title_info_alloc += 100;
@@ -397,7 +388,6 @@ _extrapolate_title(NAV_TITLE *title)
 static void _fill_clip(NAV_TITLE *title,
                        MPLS_CLIP *mpls_clip,
                        uint8_t connection_condition, uint32_t in_time, uint32_t out_time,
-                       unsigned pi_angle_count,
                        NAV_CLIP *clip,
                        unsigned ref, uint32_t *pos, uint32_t *time)
 
@@ -406,20 +396,13 @@ static void _fill_clip(NAV_TITLE *title,
 
     clip->title = title;
     clip->ref   = ref;
-
-    if (title->angle >= pi_angle_count) {
-        clip->angle = 0;
-    } else {
-        clip->angle = title->angle;
-    }
-
+    clip->angle = 0;
     strncpy(clip->name, mpls_clip[clip->angle].clip_id, 5);
     strncpy(&clip->name[5], ".m2ts", 6);
     clip->clip_id = atoi(mpls_clip[clip->angle].clip_id);
 
     path = str_printf("%s"DIR_SEP"BDMV"DIR_SEP"CLIPINF"DIR_SEP"%s.clpi",
                       title->root, mpls_clip[clip->angle].clip_id);
-    clpi_free(clip->cl);
     clip->cl = clpi_parse(path, 0);
     X_FREE(path);
     if (clip->cl == NULL) {
@@ -434,12 +417,8 @@ static void _fill_clip(NAV_TITLE *title,
             clip->connection = CONNECT_SEAMLESS;
             break;
         default:
-            if (ref) {
-                clip->start_pkt = clpi_lookup_spn(clip->cl, in_time, 1,
+            clip->start_pkt = clpi_lookup_spn(clip->cl, in_time, 1,
                                               mpls_clip[clip->angle].stc_id);
-            } else {
-                clip->start_pkt = 0;
-            }
             clip->connection = CONNECT_NON_SEAMLESS;
             break;
     }
@@ -453,7 +432,7 @@ static void _fill_clip(NAV_TITLE *title,
     *time += clip->out_time - clip->in_time;
 }
 
-NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle)
+NAV_TITLE* nav_title_open(const char *root, const char *playlist)
 {
     NAV_TITLE *title = NULL;
     char *path;
@@ -472,7 +451,7 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle
     path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST" DIR_SEP "%s",
                       root, playlist);
     title->angle_count = 0;
-    title->angle = angle;
+    title->angle = 0;
     title->pl = mpls_parse(path, 0);
     if (title->pl == NULL) {
         BD_DEBUG(DBG_NAV, "Fail: Playlist parse %s\n", path);
@@ -493,8 +472,7 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle
 
         clip = &title->clip_list.clip[ii];
 
-        _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
-                   clip, ii, &pos, &time);
+        _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, clip, ii, &pos, &time);
     }
 
     // sub paths
@@ -515,8 +493,7 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle
                 MPLS_SUB_PI *pi   = &title->pl->sub_path[ss].sub_play_item[ii];
                 NAV_CLIP    *clip = &sub_path->clip_list.clip[ii];
 
-                _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, 0,
-                           clip, ii, &pos, &time);
+                _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, clip, ii, &pos, &time);
             }
         }
     }
@@ -534,11 +511,6 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle
     title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));
 
     _extrapolate_title(title);
-
-    if (title->angle >= title->angle_count) {
-        title->angle = 0;
-    }
-
     return title;
 }
 
@@ -772,6 +744,7 @@ NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip)
 
 NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle)
 {
+    char *path;
     int ii;
     uint32_t pos = 0;
     uint32_t time = 0;
@@ -797,9 +770,48 @@ NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle)
 
         pi = &title->pl->play_item[ii];
         clip = &title->clip_list.clip[ii];
+        if (title->angle >= pi->angle_count) {
+            clip->angle = 0;
+        } else {
+            clip->angle = title->angle;
+        }
 
-        _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
-                   clip, ii, &pos, &time);
+        clpi_free(clip->cl);
+
+        clip->ref = ii;
+        strncpy(clip->name, pi->clip[clip->angle].clip_id, 5);
+        strncpy(&clip->name[5], ".m2ts", 6);
+        clip->clip_id  = atoi(pi->clip[clip->angle].clip_id);
+
+        path = str_printf("%s"DIR_SEP"BDMV"DIR_SEP"CLIPINF"DIR_SEP"%s.clpi",
+                      title->root, pi->clip[clip->angle].clip_id);
+        clip->cl = clpi_parse(path, 0);
+        X_FREE(path);
+        if (clip->cl == NULL) {
+            clip->start_pkt = 0;
+            clip->end_pkt = 0;
+            continue;
+        }
+        switch (pi->connection_condition) {
+            case 5:
+            case 6:
+                clip->start_pkt = 0;
+                clip->connection = CONNECT_SEAMLESS;
+                break;
+            default:
+                clip->start_pkt = clpi_lookup_spn(clip->cl, pi->in_time, 1,
+                                                  pi->clip[clip->angle].stc_id);
+                clip->connection = CONNECT_NON_SEAMLESS;
+            break;
+        }
+        clip->end_pkt = clpi_lookup_spn(clip->cl, pi->out_time, 0,
+                                        pi->clip[clip->angle].stc_id);
+        clip->in_time = pi->in_time;
+        clip->out_time = pi->out_time;
+        clip->pos = pos;
+        pos += clip->end_pkt - clip->start_pkt;
+        clip->start_time = time;
+        time += clip->out_time - clip->in_time;
     }
     _extrapolate_title(title);
     return clip;
diff --git a/src/libbluray/bdnav/navigation.h b/src/libbluray/bdnav/navigation.h
index 497e903..88caa56 100644
--- a/src/libbluray/bdnav/navigation.h
+++ b/src/libbluray/bdnav/navigation.h
@@ -137,7 +137,7 @@ struct nav_title_list_s
 
 BD_PRIVATE uint8_t nav_lookup_aspect(NAV_CLIP *clip, int pid);
 BD_PRIVATE char* nav_find_main_title(const char *root);
-BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle);
+BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist);
 BD_PRIVATE void nav_title_close(NAV_TITLE *title);
 BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip);
 BD_PRIVATE NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
@@ -150,7 +150,7 @@ BD_PRIVATE NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *
 BD_PRIVATE uint32_t nav_angle_change_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *time);
 BD_PRIVATE NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle);
 
-BD_PRIVATE NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags, uint32_t min_title_length);
+BD_PRIVATE NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags);
 BD_PRIVATE void nav_free_title_list(NAV_TITLE_LIST *title_list);
 
 #endif // _NAVIGATION_H_
diff --git a/src/libbluray/bdnav/uo_mask_table.h b/src/libbluray/bdnav/uo_mask_table.h
index b5dceef..2b642ae 100644
--- a/src/libbluray/bdnav/uo_mask_table.h
+++ b/src/libbluray/bdnav/uo_mask_table.h
@@ -67,7 +67,7 @@ static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b)
     unsigned   i;
 
     for (i = 0; i < sizeof(BD_UO_MASK); i++) {
-        po[i] = pa[i] | pb[i];
+        po[i] = pa[i] & pb[i];
     }
 
     return o;
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index e6984ba..38d1ee1 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -78,8 +78,6 @@ typedef struct {
     /* current aligned unit */
     uint16_t       int_buf_off;
 
-    BD_UO_MASK     uo_mask;
-
 } BD_STREAM;
 
 typedef struct {
@@ -297,9 +295,6 @@ static void _close_m2ts(BD_STREAM *st)
         file_close(st->fp);
         st->fp = NULL;
     }
-
-    /* reset UO mask */
-    memset(&st->uo_mask, 0, sizeof(st->uo_mask));
 }
 
 static int _open_m2ts(BLURAY *bd, BD_STREAM *st)
@@ -333,10 +328,6 @@ static int _open_m2ts(BLURAY *bd, BD_STREAM *st)
             }
 
             if (st == &bd->st0) {
-                MPLS_PL *pl = st->clip->title->pl;
-                st->uo_mask = bd_uo_mask_combine(pl->app_info.uo_mask,
-                                                 pl->play_item[st->clip->ref].uo_mask);
-
                 _update_clip_psrs(bd, st->clip);
             }
 
@@ -747,8 +738,7 @@ static int _libbdplus_open(BLURAY *bd, const char *keyfile_path)
         return 0;
     }
 
-    const uint8_t *aacs_vid = (const uint8_t *)_libaacs_get_vid(bd);
-    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, aacs_vid ? aacs_vid : vid);
+    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, _libaacs_get_vid(bd) ?: vid);
 
     if (bd->bdplus) {
         BD_DEBUG(DBG_BLURAY,"libbdplus initialized\n");
@@ -1173,10 +1163,7 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
                         return 0;
                     }
                     if (pi->still_mode == BLURAY_STILL_TIME) {
-                        if (bd->event_queue) {
-                            _queue_event(bd, (BD_EVENT){BD_EVENT_STILL_TIME, pi->still_time});
-                            return 0;
-                        }
+                        _queue_event(bd, (BD_EVENT){BD_EVENT_STILL_TIME, pi->still_time});
                     }
 
                     // find next clip
@@ -1189,6 +1176,14 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
                     if (!_open_m2ts(bd, st)) {
                         return -1;
                     }
+
+                    // timed still mode: allow application to process BD_EVENT_STILL_TIME.
+                    // next bd_read() will return new data.
+                    if (bd->event_queue) {
+                        if (pi->still_mode == BLURAY_STILL_TIME) {
+                            return 0;
+                        }
+                    }
                 }
 
                 if (_read_block(bd, st, bd->int_buf)) {
@@ -1226,24 +1221,6 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
     return -1;
 }
 
-int bd_read_skip_still(BLURAY *bd)
-{
-    BD_STREAM *st = &bd->st0;
-
-    if (st->clip) {
-        MPLS_PI *pi = &st->clip->title->pl->play_item[st->clip->ref];
-
-        if (pi->still_mode == BLURAY_STILL_TIME) {
-            st->clip = nav_next_clip(bd->title, st->clip);
-            if (st->clip) {
-                return _open_m2ts(bd, st);
-            }
-        }
-    }
-
-    return 0;
-}
-
 /*
  * preloader for asynchronous sub paths
  */
@@ -1322,11 +1299,11 @@ static void _close_playlist(BLURAY *bd)
     }
 }
 
-static int _open_playlist(BLURAY *bd, const char *f_name, unsigned angle)
+static int _open_playlist(BLURAY *bd, const char *f_name)
 {
     _close_playlist(bd);
 
-    bd->title = nav_title_open(bd->device_path, f_name, angle);
+    bd->title = nav_title_open(bd->device_path, f_name);
     if (bd->title == NULL) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n",
               f_name, bd);
@@ -1370,7 +1347,7 @@ int bd_select_playlist(BLURAY *bd, uint32_t playlist)
         }
     }
 
-    result = _open_playlist(bd, f_name, 0);
+    result = _open_playlist(bd, f_name);
 
     X_FREE(f_name);
     return result;
@@ -1396,7 +1373,7 @@ int bd_select_title(BLURAY *bd, uint32_t title_idx)
     bd->title_idx = title_idx;
     f_name = bd->title_list->title_info[title_idx].name;
 
-    return _open_playlist(bd, f_name, 0);
+    return _open_playlist(bd, f_name);
 }
 
 uint32_t bd_get_current_title(BLURAY *bd)
@@ -1455,7 +1432,7 @@ void bd_seamless_angle_change(BLURAY *bd, unsigned angle)
  * title lists
  */
 
-uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
+uint32_t bd_get_titles(BLURAY *bd, uint8_t flags)
 {
     if (!bd) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_get_titles(NULL) failed (%p)\n", bd);
@@ -1465,7 +1442,7 @@ uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
     if (bd->title_list != NULL) {
         nav_free_title_list(bd->title_list);
     }
-    bd->title_list = nav_get_title_list(bd->device_path, flags, min_title_length);
+    bd->title_list = nav_get_title_list(bd->device_path, flags);
 
     if (!bd->title_list) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "nav_get_title_list(%s) failed (%p)\n", bd->device_path, bd);
@@ -1541,13 +1518,12 @@ static BLURAY_TITLE_INFO* _fill_title_info(NAV_TITLE* title, uint32_t title_idx,
     return title_info;
 }
 
-static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32_t playlist, const char *mpls_name,
-                                          unsigned angle)
+static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32_t playlist, const char *mpls_name)
 {
     NAV_TITLE *title;
     BLURAY_TITLE_INFO *title_info;
 
-    title = nav_title_open(bd->device_path, mpls_name, angle);
+    title = nav_title_open(bd->device_path, mpls_name);
     if (title == NULL) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s! (%p)\n",
               mpls_name, bd);
@@ -1560,7 +1536,7 @@ static BLURAY_TITLE_INFO *_get_title_info(BLURAY *bd, uint32_t title_idx, uint32
     return title_info;
 }
 
-BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
+BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx)
 {
     if (bd->title_list == NULL) {
         BD_DEBUG(DBG_BLURAY, "Title list not yet read! (%p)\n", bd);
@@ -1573,16 +1549,15 @@ BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned an
 
     return _get_title_info(bd,
                            title_idx, bd->title_list->title_info[title_idx].mpls_id,
-                           bd->title_list->title_info[title_idx].name,
-                           angle);
+                           bd->title_list->title_info[title_idx].name);
 }
 
-BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
+BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist)
 {
     char *f_name = str_printf("%05d.mpls", playlist);
     BLURAY_TITLE_INFO *title_info;
 
-    title_info = _get_title_info(bd, 0, playlist, f_name, angle);
+    title_info = _get_title_info(bd, 0, playlist, f_name);
 
     X_FREE(f_name);
 
@@ -1699,43 +1674,6 @@ static void _process_psr_event(void *handle, BD_PSR_EVENT *ev)
 {
     BLURAY *bd = (BLURAY*)handle;
 
-    /* PSR restore events are handled internally */
-
-    if (ev->ev_type == BD_PSR_RESTORE) {
-
-        BD_DEBUG(DBG_BLURAY, "PSR RESTORE event %d %d (%p)\n", ev->psr_idx, ev->new_val, bd);
-
-        /* Restore stored playback position */
-
-        switch (ev->psr_idx) {
-            case PSR_ANGLE_NUMBER:
-                /* can't set angle before playlist is opened */
-                return;
-            case PSR_TITLE_NUMBER:
-                /* pass to the application */
-                break;
-            case PSR_CHAPTER:
-                /* will be selected automatically */
-                return;
-            case PSR_PLAYLIST:
-                bd_select_playlist(bd, ev->new_val);
-                nav_set_angle(bd->title, bd->st0.clip, bd_psr_read(bd->regs, PSR_ANGLE_NUMBER) - 1);
-                return;
-            case PSR_PLAYITEM:
-                bd_seek_playitem(bd, ev->new_val);
-                return;
-            case PSR_TIME:
-                bd_seek_time(bd, ((int64_t)ev->new_val) << 1);
-                return;
-            case PSR_SELECTED_BUTTON_ID:
-            case PSR_MENU_PAGE_ID:
-                /* TODO: need to inform graphics controller ? */
-            default:
-                /* others: ignore */
-                return;
-        }
-    }
-
     BD_DEBUG(DBG_BLURAY, "PSR event %d %d (%p)\n", ev->psr_idx, ev->new_val, bd);
 
     switch (ev->psr_idx) {
@@ -1825,8 +1763,6 @@ static int _play_bdj(BLURAY *bd, const char *name)
 
 static int _play_hdmv(BLURAY *bd, unsigned id_ref)
 {
-    int result = 1;
-
     bd->title_type = title_hdmv;
 
 #ifdef USING_BDJAVA
@@ -1834,16 +1770,16 @@ static int _play_hdmv(BLURAY *bd, unsigned id_ref)
 #endif
 
     if (!bd->hdmv_vm) {
-        bd->hdmv_vm = hdmv_vm_init(bd->device_path, bd->regs, bd->index);
+        bd->hdmv_vm = hdmv_vm_init(bd->device_path, bd->regs);
     }
 
     if (hdmv_vm_select_object(bd->hdmv_vm, id_ref)) {
-        result = 0;
+        return 0;
     }
 
     bd->hdmv_suspended = !hdmv_vm_running(bd->hdmv_vm);
 
-    return result;
+    return 1;
 }
 
 static int _play_title(BLURAY *bd, unsigned title)
@@ -1926,10 +1862,8 @@ int bd_play(BLURAY *bd)
 
     _init_event_queue(bd);
 
-    bd_psr_lock(bd->regs);
     bd_psr_register_cb(bd->regs, _process_psr_event, bd);
     _queue_initial_psr_events(bd);
-    bd_psr_unlock(bd->regs);
 
     return _play_title(bd, BLURAY_TITLE_FIRST_PLAY);
 }
@@ -1937,12 +1871,7 @@ int bd_play(BLURAY *bd)
 int bd_play_title(BLURAY *bd, unsigned title)
 {
     if (bd->title_type == title_undef && title != BLURAY_TITLE_FIRST_PLAY) {
-        BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_play_title(): bd_play() not called\n");
-        return 0;
-    }
-
-    if (bd->st0.uo_mask.title_search) {
-        BD_DEBUG(DBG_BLURAY|DBG_CRIT, "title search masked by stream\n");
+        // bd_play not called
         return 0;
     }
 
@@ -1963,12 +1892,7 @@ int bd_menu_call(BLURAY *bd, int64_t pts)
     }
 
     if (bd->title_type == title_undef) {
-        BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_menu_call(): bd_play() not called\n");
-        return 0;
-    }
-
-    if (bd->st0.uo_mask.menu_call) {
-        BD_DEBUG(DBG_BLURAY|DBG_CRIT, "menu call masked by stream\n");
+        // bd_play not called
         return 0;
     }
 
@@ -1977,10 +1901,6 @@ int bd_menu_call(BLURAY *bd, int64_t pts)
             BD_DEBUG(DBG_BLURAY|DBG_CRIT, "menu call masked by movie object\n");
             return 0;
         }
-
-        if (hdmv_vm_suspend_pl(bd->hdmv_vm) < 0) {
-            BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_menu_call(): error storing playback location\n");
-        }
     }
 
     return _play_title(bd, BLURAY_TITLE_TOP_MENU);
@@ -2055,6 +1975,7 @@ static void _process_hdmv_vm_event(BLURAY *bd, HDMV_EVENT *hev)
             break;
 
         case HDMV_EVENT_IG_END:
+            BD_DEBUG(DBG_BLURAY|DBG_CRIT, "HDMV_EVENT_IG_END\n");
             _run_gc(bd, GC_CTRL_IG_END, 0);
             break;
 
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index c0566d9..6f5dd1f 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -22,10 +22,6 @@
 #ifndef BLURAY_H_
 #define BLURAY_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * @file libbluray/bluray.h
  * external API header
@@ -174,10 +170,9 @@ typedef struct bd_title_info {
  *
  * @param bd  BLURAY object
  * @param flags  title flags
- * @param min_title_length  filter out titles shorter than min_title_length seconds
  * @return number of titles found
  */
-uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length);
+uint32_t bd_get_titles(BLURAY *bd, uint8_t flags);
 
 /**
  *
@@ -185,10 +180,9 @@ uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length);
  *
  * @param bd  BLURAY object
  * @param title_idx title index number
- * @param angle angle number (chapter offsets and clip size depend on selected angle)
  * @return allocated BLURAY_TITLE_INFO object, NULL on error
  */
-BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle);
+BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx);
 
 /**
  *
@@ -196,10 +190,9 @@ BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned an
  *
  * @param bd  BLURAY object
  * @param playlist playlist number
- * @param angle angle number (chapter offsets and clip size depend on selected angle)
  * @return allocated BLURAY_TITLE_INFO object, NULL on error
  */
-BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle);
+BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist);
 
 /**
  *
@@ -257,15 +250,6 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len);
 
 /**
  *
- *  Continue reading after still mode clip
- *
- * @param bd  BLURAY object
- * @return 0 on error
- */
-int bd_read_skip_still(BLURAY *bd);
-
-/**
- *
  *  Seek to a chapter. First chapter is 0
  *
  * @param bd  BLURAY object
@@ -645,8 +629,4 @@ struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref);
  */
 void bd_free_clpi(struct clpi_cl *cl);
 
-#ifdef __cplusplus
-};
-#endif
-
 #endif /* BLURAY_H_ */
diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index dd3109c..a2c595d 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -31,7 +31,6 @@
 #include "../keys.h"
 
 #include <inttypes.h>
-#include <string.h>
 
 #define GC_ERROR(...) BD_DEBUG(DBG_GC | DBG_CRIT, __VA_ARGS__)
 #define GC_TRACE(...) BD_DEBUG(DBG_GC,            __VA_ARGS__)
@@ -40,11 +39,6 @@
  *
  */
 
-typedef struct {
-    uint16_t enabled_button;  /* enabled button id */
-    uint16_t x, y, w, h;      /* button rect on overlay plane (if drawn) */
-} BOG_DATA;
-
 struct graphics_controller_s {
 
     BD_REGISTERS   *regs;
@@ -60,11 +54,11 @@ struct graphics_controller_s {
     unsigned        pg_drawn;
     unsigned        popup_visible;
     unsigned        valid_mouse_position;
-    BOG_DATA       *bog_data;
 
     /* data */
     PG_DISPLAY_SET *pgs;
     PG_DISPLAY_SET *igs;
+    uint16_t       *enabled_button;
 
     /* */
     GRAPHICS_PROCESSOR *pgp;
@@ -177,7 +171,7 @@ static int _is_button_enabled(GRAPHICS_CONTROLLER *gc, BD_IG_PAGE *page, unsigne
 {
     unsigned ii;
     for (ii = 0; ii < page->num_bogs; ii++) {
-        if (gc->bog_data[ii].enabled_button == button_id) {
+        if (gc->enabled_button[ii] == button_id) {
             return 1;
         }
     }
@@ -213,12 +207,11 @@ static uint16_t _find_selected_button_id(GRAPHICS_CONTROLLER *gc)
     /* 2) fallback to current PSR10 value if it is valid */
     for (ii = 0; ii < page->num_bogs; ii++) {
         BD_IG_BOG *bog = &page->bog[ii];
-        uint16_t   enabled_button = gc->bog_data[ii].enabled_button;
 
-        if (button_id == enabled_button) {
-            if (_find_button_bog(bog, enabled_button)) {
-                GC_TRACE("_find_selected_button_id() -> PSR10 #%d\n", enabled_button);
-                return enabled_button;
+        if (button_id == gc->enabled_button[ii]) {
+            if (_find_button_bog(bog, gc->enabled_button[ii])) {
+                GC_TRACE("_find_selected_button_id() -> PSR10 #%d\n", gc->enabled_button[ii]);
+                return gc->enabled_button[ii];
             }
         }
     }
@@ -226,11 +219,10 @@ static uint16_t _find_selected_button_id(GRAPHICS_CONTROLLER *gc)
     /* 3) fallback to find first valid_button_id_ref from page */
     for (ii = 0; ii < page->num_bogs; ii++) {
         BD_IG_BOG *bog = &page->bog[ii];
-        uint16_t   enabled_button = gc->bog_data[ii].enabled_button;
 
-        if (_find_button_bog(bog, enabled_button)) {
-            GC_TRACE("_find_selected_button_id() -> first valid #%d\n", enabled_button);
-            return enabled_button;
+        if (_find_button_bog(bog, gc->enabled_button[ii])) {
+            GC_TRACE("_find_selected_button_id() -> first valid #%d\n", gc->enabled_button[ii]);
+            return gc->enabled_button[ii];
         }
     }
 
@@ -238,7 +230,7 @@ static uint16_t _find_selected_button_id(GRAPHICS_CONTROLLER *gc)
     return 0xffff;
 }
 
-static void _reset_page_state(GRAPHICS_CONTROLLER *gc)
+static void _reset_enabled_button(GRAPHICS_CONTROLLER *gc)
 {
     PG_DISPLAY_SET *s       = gc->igs;
     BD_IG_PAGE     *page    = NULL;
@@ -247,44 +239,36 @@ static void _reset_page_state(GRAPHICS_CONTROLLER *gc)
 
     page = _find_page(&s->ics->interactive_composition, page_id);
     if (!page) {
-        GC_ERROR("_reset_page_state(): unknown page #%d (have %d pages)\n",
+        GC_ERROR("_reset_enabled_button(): unknown page #%d (have %d pages)\n",
               page_id, s->ics->interactive_composition.num_pages);
         return;
     }
 
-    size_t size = page->num_bogs * sizeof(*gc->bog_data);
-    gc->bog_data = realloc(gc->bog_data, size);
-
-    memset(gc->bog_data, 0, size);
+    gc->enabled_button = realloc(gc->enabled_button,
+                                 page->num_bogs * sizeof(uint16_t));
 
     for (ii = 0; ii < page->num_bogs; ii++) {
-        gc->bog_data[ii].enabled_button = page->bog[ii].default_valid_button_id_ref;
+        gc->enabled_button[ii] = page->bog[ii].default_valid_button_id_ref;
     }
 }
 
-static void _clear_osd_area(GRAPHICS_CONTROLLER *gc, int plane,
-                            uint16_t x, uint16_t y, uint16_t w, uint16_t h)
+static void _clear_osd(GRAPHICS_CONTROLLER *gc, int plane)
 {
     if (gc->overlay_proc) {
         /* clear plane */
         const BD_OVERLAY ov = {
             .pts     = -1,
             .plane   = plane,
-            .x       = x,
-            .y       = y,
-            .w       = w,
-            .h       = h,
+            .x       = 0,
+            .y       = 0,
+            .w       = 1920,
+            .h       = 1080,
             .palette = NULL,
             .img     = NULL,
         };
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
     }
-}
-
-static void _clear_osd(GRAPHICS_CONTROLLER *gc, int plane)
-{
-    _clear_osd_area(gc, plane, 0, 0, 1920, 1080);
 
     if (plane) {
         gc->ig_drawn      = 0;
@@ -293,21 +277,11 @@ static void _clear_osd(GRAPHICS_CONTROLLER *gc, int plane)
     }
 }
 
-static void _clear_bog_area(GRAPHICS_CONTROLLER *gc, BOG_DATA *bog_data)
-{
-    if (gc->ig_drawn && bog_data->w && bog_data->h) {
-
-        _clear_osd_area(gc, 1, bog_data->x, bog_data->y, bog_data->w, bog_data->h);
-
-        bog_data->x = bog_data->y = bog_data->w = bog_data->h = 0;
-    }
-}
-
 static void _select_page(GRAPHICS_CONTROLLER *gc, uint16_t page_id)
 {
     bd_psr_write(gc->regs, PSR_MENU_PAGE_ID, page_id);
     _clear_osd(gc, 1);
-    _reset_page_state(gc);
+    _reset_enabled_button(gc);
 
     uint16_t button_id = _find_selected_button_id(gc);
     bd_psr_write(gc->regs, PSR_SELECTED_BUTTON_ID, button_id);
@@ -326,7 +300,7 @@ static void _gc_reset(GRAPHICS_CONTROLLER *gc)
     pg_display_set_free(&gc->pgs);
     pg_display_set_free(&gc->igs);
 
-    X_FREE(gc->bog_data);
+    X_FREE(gc->enabled_button);
 }
 
 /*
@@ -367,11 +341,11 @@ void gc_free(GRAPHICS_CONTROLLER **p)
  * graphics stream input
  */
 
-int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
+void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
 {
     if (!gc) {
         GC_TRACE("gc_decode_ts(): no graphics controller\n");
-        return -1;
+        return;
     }
 
     if (pid >= 0x1400 && pid < 0x1500) {
@@ -388,7 +362,7 @@ int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned
                                      stc);
         if (!gc->igs || !gc->igs->complete) {
             bd_mutex_unlock(&gc->mutex);
-            return 0;
+            return;
         }
 
         gc->popup_visible = 0;
@@ -396,8 +370,6 @@ int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned
         _select_page(gc, 0);
 
         bd_mutex_unlock(&gc->mutex);
-
-        return 1;
     }
 
     else if (pid >= 0x1200 && pid < 0x1300) {
@@ -410,13 +382,9 @@ int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned
                                      stc);
 
         if (!gc->pgs || !gc->pgs->complete) {
-            return 0;
+            return;
         }
-
-        return 1;
     }
-
-    return -1;
 }
 
 /*
@@ -424,7 +392,7 @@ int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned
  */
 
 static void _render_button(GRAPHICS_CONTROLLER *gc, BD_IG_BUTTON *button, BD_PG_PALETTE *palette,
-                           int state, BOG_DATA *bog_data)
+                           int state)
 {
     BD_PG_OBJECT *object    = NULL;
     BD_OVERLAY    ov;
@@ -432,19 +400,16 @@ static void _render_button(GRAPHICS_CONTROLLER *gc, BD_IG_BUTTON *button, BD_PG_
     object = _find_object_for_button(gc->igs, button, state);
     if (!object) {
         GC_TRACE("_render_button(#%d): object (state %d) not found\n", button->id, state);
-
-        _clear_bog_area(gc, bog_data);
-
         return;
     }
 
     ov.pts   = -1;
     ov.plane = 1; /* IG */
 
-    ov.x = bog_data->x = button->x_pos;
-    ov.y = bog_data->y = button->y_pos;
-    ov.w = bog_data->w = object->width;
-    ov.h = bog_data->h = object->height;
+    ov.x = button->x_pos;
+    ov.y = button->y_pos;
+    ov.w = object->width;
+    ov.h = object->height;
 
     ov.img     = object->img;
     ov.palette = palette->entry;
@@ -493,7 +458,7 @@ static void _render_page(GRAPHICS_CONTROLLER *gc,
 
     for (ii = 0; ii < page->num_bogs; ii++) {
         BD_IG_BOG    *bog      = &page->bog[ii];
-        unsigned      valid_id = gc->bog_data[ii].enabled_button;
+        unsigned      valid_id = gc->enabled_button[ii];
         BD_IG_BUTTON *button;
 
         button = _find_button_bog(bog, valid_id);
@@ -502,21 +467,21 @@ static void _render_page(GRAPHICS_CONTROLLER *gc,
             GC_TRACE("_render_page(): bog %d: button %d not found\n", ii, valid_id);
 
         } else if (button->id == activated_button_id) {
-            _render_button(gc, button, palette, BTN_ACTIVATED, &gc->bog_data[ii]);
+            _render_button(gc, button, palette, BTN_ACTIVATED);
 
         } else if (button->id == selected_button_id) {
 
-            _render_button(gc, button, palette, BTN_SELECTED, &gc->bog_data[ii]);
+            _render_button(gc, button, palette, BTN_SELECTED);
 
             bd_psr_write(gc->regs, PSR_SELECTED_BUTTON_ID, selected_button_id);
 
-            if (button->auto_action_flag && cmds) {
+            if (button->auto_action_flag) {
                 cmds->num_nav_cmds = button->num_nav_cmds;
                 cmds->nav_cmds     = button->nav_cmds;
             }
 
         } else {
-            _render_button(gc, button, palette, BTN_NORMAL, &gc->bog_data[ii]);
+            _render_button(gc, button, palette, BTN_NORMAL);
 
         }
     }
@@ -568,7 +533,7 @@ static int _user_input(GRAPHICS_CONTROLLER *gc, bd_vk_key_e key, GC_NAV_CMDS *cm
 
     for (ii = 0; ii < page->num_bogs; ii++) {
         BD_IG_BOG *bog      = &page->bog[ii];
-        unsigned   valid_id = gc->bog_data[ii].enabled_button;
+        unsigned   valid_id = gc->enabled_button[ii];
         BD_IG_BUTTON *button = _find_button_bog(bog, valid_id);
         if (!button) {
             continue;
@@ -631,7 +596,7 @@ static int _user_input(GRAPHICS_CONTROLLER *gc, bd_vk_key_e key, GC_NAV_CMDS *cm
     return 0;
 }
 
-static void _set_button_page(GRAPHICS_CONTROLLER *gc, uint32_t param)
+static void _set_button_page(GRAPHICS_CONTROLLER *gc, uint32_t param, GC_NAV_CMDS *cmds)
 {
     unsigned page_flag   = param & 0x80000000;
     unsigned effect_flag = param & 0x40000000;
@@ -703,11 +668,11 @@ static void _set_button_page(GRAPHICS_CONTROLLER *gc, uint32_t param)
     }
 
     if (button) {
-        gc->bog_data[bog_idx].enabled_button = button_id;
+        gc->enabled_button[bog_idx] = button_id;
         bd_psr_write(gc->regs, PSR_SELECTED_BUTTON_ID, button_id);
     }
 
-    _render_page(gc, 0xffff, NULL);
+    _render_page(gc, 0xffff, cmds);
 }
 
 static void _enable_button(GRAPHICS_CONTROLLER *gc, uint32_t button_id, unsigned enable)
@@ -736,15 +701,15 @@ static void _enable_button(GRAPHICS_CONTROLLER *gc, uint32_t button_id, unsigned
     }
 
     if (enable) {
-        if (gc->bog_data[bog_idx].enabled_button == cur_btn_id) {
+        if (gc->enabled_button[bog_idx] == cur_btn_id) {
             /* selected button goes to disabled state */
             bd_psr_write(gc->regs, PSR_SELECTED_BUTTON_ID, 0x10000|button_id);
         }
-        gc->bog_data[bog_idx].enabled_button = button_id;
+        gc->enabled_button[bog_idx] = button_id;
 
     } else {
-        if (gc->bog_data[bog_idx].enabled_button == button_id) {
-            gc->bog_data[bog_idx].enabled_button = 0xffff;
+        if (gc->enabled_button[bog_idx] == button_id) {
+            gc->enabled_button[bog_idx] = 0xffff;
         }
 
         if (cur_btn_id == button_id) {
@@ -799,7 +764,7 @@ static int _mouse_move(GRAPHICS_CONTROLLER *gc, unsigned x, unsigned y, GC_NAV_C
 
     for (ii = 0; ii < page->num_bogs; ii++) {
         BD_IG_BOG    *bog      = &page->bog[ii];
-        unsigned      valid_id = gc->bog_data[ii].enabled_button;
+        unsigned      valid_id = gc->enabled_button[ii];
         BD_IG_BUTTON *button   = _find_button_bog(bog, valid_id);
 
         if (!button)
@@ -874,7 +839,7 @@ int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS
     switch (ctrl) {
 
         case GC_CTRL_SET_BUTTON_PAGE:
-            _set_button_page(gc, param);
+            _set_button_page(gc, param, cmds);
             break;
 
         case GC_CTRL_VK_KEY:
diff --git a/src/libbluray/decoders/graphics_controller.h b/src/libbluray/decoders/graphics_controller.h
index 33efdd2..a0123e2 100644
--- a/src/libbluray/decoders/graphics_controller.h
+++ b/src/libbluray/decoders/graphics_controller.h
@@ -40,21 +40,15 @@ typedef struct graphics_controller_s GRAPHICS_CONTROLLER;
 typedef void (*gc_overlay_proc_f)(void *, const struct bd_overlay_s * const);
 
 typedef enum {
-    /* */
-    GC_CTRL_NOP,             /* No input. Render page / run timers / run animations */
-    GC_CTRL_RESET,           /* reset graphics controller */
-
-    /* user input */
+    GC_CTRL_NOP,
     GC_CTRL_VK_KEY,          /* param: bd_vk_key_e */
-    GC_CTRL_MOUSE_MOVE,      /* move selected button to (x,y), param: (x<<16 | y) */
-
-    /* HDMV VM control messages */
     GC_CTRL_ENABLE_BUTTON,   /* param: button_id */
     GC_CTRL_DISABLE_BUTTON,  /* param: button_id */
     GC_CTRL_SET_BUTTON_PAGE,
     GC_CTRL_POPUP,           /* param: on/off */
     GC_CTRL_IG_END,          /* execution of IG object is complete */
-
+    GC_CTRL_RESET,           /* reset graphics controller */
+    GC_CTRL_MOUSE_MOVE,      /* move selected button to (x,y), param: (x<<16 | y) */
 } gc_ctrl_e;
 
 typedef struct {
@@ -75,18 +69,11 @@ BD_PRIVATE GRAPHICS_CONTROLLER *gc_init(struct bd_registers_s *regs,
 
 BD_PRIVATE void                 gc_free(GRAPHICS_CONTROLLER **p);
 
-/**
- *
- *  Decode data from MPEG-TS input stream
- *
- * @param p  GRAPHICS_CONTROLLER object
- * @param pid  mpeg-ts PID to decode (HDMV IG/PG stream)
- * @param block  mpeg-ts data
- * @param num_blocks  number of aligned units in data
- * @param stc  current playback time
- * @return <0 on error, 0 when not complete, >0 when complete
+/*
+ * input stream (MPEG-TS IG stream)
  */
-BD_PRIVATE int                  gc_decode_ts(GRAPHICS_CONTROLLER *p,
+
+BD_PRIVATE void                 gc_decode_ts(GRAPHICS_CONTROLLER *p,
                                              uint16_t pid,
                                              uint8_t *block, unsigned num_blocks,
                                              int64_t stc);
diff --git a/src/libbluray/decoders/graphics_processor.c b/src/libbluray/decoders/graphics_processor.c
index 8dfde2f..f3b9412 100644
--- a/src/libbluray/decoders/graphics_processor.c
+++ b/src/libbluray/decoders/graphics_processor.c
@@ -73,14 +73,28 @@ void pg_display_set_free(PG_DISPLAY_SET **s)
  * segment handling
  */
 
+static PES_BUFFER *_find_segment_by_type(PES_BUFFER *p, uint8_t seg_type)
+{
+    while (p) {
+        if (p->buf[0] == seg_type) {
+            return p;
+        }
+        p = p->next;
+    }
+    return NULL;
+}
+
 static PES_BUFFER *_find_segment_by_idv(PES_BUFFER *p,
                                         uint8_t seg_type, unsigned idv_pos,
                                         uint8_t *idv, unsigned idv_len)
 {
-    while (p && (p->buf[0] != seg_type || memcmp(p->buf + idv_pos, idv, idv_len))) {
+    while (NULL != (_find_segment_by_type(p, seg_type))) {
+        if (!memcmp(p->buf + idv_pos, idv, idv_len)) {
+            return p;
+        }
         p = p->next;
     }
-    return p;
+    return NULL;
 }
 
 static void _join_fragments(PES_BUFFER *p1, PES_BUFFER *p2, int data_pos)
@@ -220,8 +234,8 @@ static int _decode_pds(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
         for (ii = 0; ii < s->num_palette; ii++) {
             if (s->palette[ii].id == id) {
                 int rr;
-                if ( (s->ics && s->ics->composition_descriptor.state == 0) ||
-                     (s->pcs && s->pcs->composition_descriptor.state == 0)) {
+                if ( (s->ics && s->ics->composition_descriptor.state == 0)/* ||
+                     (s->pcs && s->pcs->composition_descriptor.state == 2)*/) {
                     /* 8.8.3.1.1 */
                     rr = pg_decode_palette_update(bb, &s->palette[ii]);
                 } else {
@@ -250,44 +264,14 @@ static int _decode_pds(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
     return 0;
 }
 
-static void _check_epoch_start(PG_DISPLAY_SET *s)
-{
-    if ((s->pcs && s->pcs->composition_descriptor.state == 2) ||
-        (s->ics && s->ics->composition_descriptor.state == 2)) {
-        /* epoch start, drop all cached data */
-
-        unsigned ii;
-        for (ii = 0; ii < s->num_object; ii++) {
-            pg_clean_object(&s->object[ii]);
-        }
-
-        s->num_palette = 0;
-        s->num_window  = 0;
-        s->num_object  = 0;
-
-        s->epoch_start = 1;
-
-    } else {
-        s->epoch_start = 0;
-    }
-}
-
 static int _decode_pcs(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
 {
-    pg_free_composition(&s->pcs);
-    s->pcs = calloc(1, sizeof(*s->pcs));
-
-    if (!pg_decode_composition(bb, s->pcs)) {
-        pg_free_composition(&s->pcs);
-        return 0;
-    }
-
-    s->pcs->pts  = p->pts;
-    s->valid_pts = p->pts;
-
-    _check_epoch_start(s);
+    (void)s;
+    (void)bb;
+    (void)p;
 
-    return 1;
+    BD_DEBUG(DBG_DECODE | DBG_CRIT, "unhandled segment type (PGS_PG_COMPOSITION)\n");
+    return 0;
 }
 
 static int _decode_ics(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
@@ -300,10 +284,25 @@ static int _decode_ics(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
         return 0;
     }
 
-    s->ics->pts  = p->pts;
-    s->valid_pts = p->pts;
+    s->ics->pts = p->pts;
 
-    _check_epoch_start(s);
+    s->valid_pts   = s->ics->pts;
+    s->epoch_start = 0;
+
+    if (s->ics->composition_descriptor.state == 2) {
+        /* epoch start, drop all cached data */
+
+        unsigned ii;
+        for (ii = 0; ii < s->num_object; ii++) {
+            pg_clean_object(&s->object[ii]);
+        }
+
+        s->num_palette = 0;
+        s->num_window = 0;
+        s->num_object = 0;
+
+        s->epoch_start = 1;
+    }
 
     return 1;
 }
@@ -358,7 +357,9 @@ int graphics_processor_decode_pes(PG_DISPLAY_SET **s, PES_BUFFER **p, int64_t st
         *s = calloc(1, sizeof(PG_DISPLAY_SET));
     }
 
-    while (*p) {
+    (*s)->complete = 0;
+
+    while (*p && !(*s)->complete) {
 
         /* time to decode next segment ? */
         if (stc >= 0 && (*p)->dts > stc) {
@@ -373,30 +374,18 @@ int graphics_processor_decode_pes(PG_DISPLAY_SET **s, PES_BUFFER **p, int64_t st
             return 0;
         }
 
-        if ((*p)->len <= 2) {
-            BD_DEBUG(DBG_DECODE, "segment too short, skipping (%d bytes)\n", (*p)->len);
-            pes_buffer_remove(p, *p);
-            continue;
-        }
-
-        /* decode segment */
-
         GP_TRACE("Decoding segment, dts %010"PRId64" pts %010"PRId64" len %d\n",
                  (*p)->dts, (*p)->pts, (*p)->len);
 
-        (*s)->complete = 0;
-
-        _decode_segment(*s, *p);
-
-        pes_buffer_remove(p, *p);
-
-        if ((*s)->complete) {
-            return 1;
+        /* decode segment */
+        if ((*p)->len > 2) {
+            _decode_segment(*s, *p);
         }
 
+        pes_buffer_remove(p, *p);
     }
 
-    return 0;
+    return (*s)->complete;
 }
 
 /*
@@ -447,9 +436,5 @@ int graphics_processor_decode_ts(GRAPHICS_PROCESSOR *p,
         unit += 6144;
     }
 
-    if (p->queue) {
-        return graphics_processor_decode_pes(s, &p->queue, stc);
-    }
-
-    return 0;
+    return graphics_processor_decode_pes(s, &p->queue, stc);
 }
diff --git a/src/libbluray/decoders/graphics_processor.h b/src/libbluray/decoders/graphics_processor.h
index 698b3c4..37f6287 100644
--- a/src/libbluray/decoders/graphics_processor.h
+++ b/src/libbluray/decoders/graphics_processor.h
@@ -48,7 +48,7 @@ typedef struct {
 
     /* only one of the following segments can be present */
     BD_IG_INTERACTIVE   *ics;
-    BD_PG_COMPOSITION   *pcs;
+    /*BD_PG_PRESENTATON_COMPOSITION_SEGMENT  *pcs;*/
 
 } PG_DISPLAY_SET;
 
@@ -61,40 +61,23 @@ BD_PRIVATE void pg_display_set_free(PG_DISPLAY_SET **s);
 BD_PRIVATE GRAPHICS_PROCESSOR *graphics_processor_init(void);
 BD_PRIVATE void                graphics_processor_free(GRAPHICS_PROCESSOR **p);
 
-/**
+/*
+ *  stc:      current STC
  *
- *  Decode data from MPEG-PES input stream
+ *  return:   0 : wait for more data
+ *            1 : display set complete
  *
  *  Only segments where DTS <= STC are decoded.
  *  If STC < 0, all segments are immediately decoded to display set.
  *
  *  All decoded PES packets are removed from buffer.
- *
- * @param s  display set
- * @param buf  data to decode
- * @param stc  current playback time
- * @return 1 if display set was completed, 0 otherwise
  */
+
 BD_PRIVATE int
 graphics_processor_decode_pes(PG_DISPLAY_SET **s,
                               struct pes_buffer_s **buf,
                               int64_t stc);
 
-/**
- *
- *  Decode data from MPEG-TS input stream
- *
- *  Segments are queued and decoded when DTS <= STC.
- *  If STC < 0, all segments are immediately decoded to display set.
- *
- * @param p  GRAPHICS_PROCESSOR object
- * @param s  display set
- * @param pid  mpeg-ts PID to decode (HDMV IG/PG stream)
- * @param unit  mpeg-ts data
- * @param num_units  number of aligned units in data
- * @param stc  current playback time
- * @return 1 if display set was completed, 0 otherwise
- */
 BD_PRIVATE int
 graphics_processor_decode_ts(GRAPHICS_PROCESSOR *p,
                              PG_DISPLAY_SET **s,
diff --git a/src/libbluray/decoders/pg.h b/src/libbluray/decoders/pg.h
index cbc9b99..c6b54b3 100644
--- a/src/libbluray/decoders/pg.h
+++ b/src/libbluray/decoders/pg.h
@@ -85,25 +85,5 @@ typedef struct {
 
 } BD_PG_OBJECT;
 
-typedef struct {
-    int64_t       pts;
-
-    BD_PG_VIDEO_DESCRIPTOR        video_descriptor;
-    BD_PG_COMPOSITION_DESCRIPTOR  composition_descriptor;
-
-    uint8_t       palette_update_flag;
-    uint8_t       palette_id_ref;
-
-    unsigned                  num_composition_objects;
-    BD_PG_COMPOSITION_OBJECT *composition_object;
-
-} BD_PG_COMPOSITION;
-
-typedef struct {
-    int64_t       pts;
-
-    unsigned      num_windows;
-    BD_PG_WINDOW *window;
-} BD_PG_WINDOWS;
 
 #endif // _BD_PG_H_
diff --git a/src/libbluray/decoders/pg_decode.c b/src/libbluray/decoders/pg_decode.c
index 2cafa16..3fac4b2 100644
--- a/src/libbluray/decoders/pg_decode.c
+++ b/src/libbluray/decoders/pg_decode.c
@@ -196,42 +196,6 @@ int pg_decode_object(BITBUFFER *bb, BD_PG_OBJECT *p)
     return _decode_rle(bb, p);
 }
 
-int pg_decode_composition(BITBUFFER *bb, BD_PG_COMPOSITION *p)
-{
-    unsigned ii;
-
-    pg_decode_video_descriptor(bb, &p->video_descriptor);
-    pg_decode_composition_descriptor(bb, &p->composition_descriptor);
-
-    p->palette_update_flag = bb_read(bb, 1);
-    bb_skip(bb, 7);
-
-    p->palette_id_ref      = bb_read(bb, 8);
-
-    p->num_composition_objects = bb_read(bb, 8);
-    p->composition_object      = calloc(p->num_composition_objects, sizeof(BD_PG_COMPOSITION_OBJECT));
-
-    for (ii = 0; ii < p->num_composition_objects; ii++) {
-        pg_decode_composition_object(bb, &p->composition_object[ii]);
-    }
-
-    return 1;
-}
-
-int pg_decode_windows(BITBUFFER *bb, BD_PG_WINDOWS *p)
-{
-    unsigned ii;
-
-    p->num_windows = bb_read(bb, 8);
-    p->window = calloc(p->num_windows, sizeof(BD_PG_WINDOW));
-
-    for (ii = 0; ii < p->num_windows; ii++) {
-        pg_decode_window(bb, &p->window[ii]);
-    }
-
-    return 1;
-}
-
 /*
  * cleanup
  */
@@ -243,17 +207,10 @@ void pg_clean_object(BD_PG_OBJECT *p)
     }
 }
 
-void pg_clean_composition(BD_PG_COMPOSITION *p)
+void pg_free_window(BD_PG_WINDOW **p)
 {
-    if (p) {
-        X_FREE(p->composition_object);
-    }
-}
-
-void pg_clean_windows(BD_PG_WINDOWS *p)
-{
-    if (p) {
-        X_FREE(p->window);
+    if (p && *p) {
+        X_FREE(*p);
     }
 }
 
@@ -271,19 +228,3 @@ void pg_free_object(BD_PG_OBJECT **p)
         X_FREE(*p);
     }
 }
-
-void pg_free_composition(BD_PG_COMPOSITION **p)
-{
-    if (p && *p) {
-        pg_clean_composition(*p);
-        X_FREE(*p);
-    }
-}
-
-void pg_free_windows(BD_PG_WINDOWS **p)
-{
-    if (p && *p) {
-        pg_clean_windows(*p);
-        X_FREE(*p);
-    }
-}
diff --git a/src/libbluray/decoders/pg_decode.h b/src/libbluray/decoders/pg_decode.h
index 975b9e2..169efe7 100644
--- a/src/libbluray/decoders/pg_decode.h
+++ b/src/libbluray/decoders/pg_decode.h
@@ -42,20 +42,15 @@ BD_PRIVATE void pg_decode_composition_object(BITBUFFER *bb, BD_PG_COMPOSITION_OB
 BD_PRIVATE int pg_decode_palette_update(BITBUFFER *bb, BD_PG_PALETTE *p);
 BD_PRIVATE int pg_decode_palette(BITBUFFER *bb, BD_PG_PALETTE *p);
 BD_PRIVATE int pg_decode_object(BITBUFFER *bb, BD_PG_OBJECT *p);
-BD_PRIVATE int pg_decode_composition(BITBUFFER *bb, BD_PG_COMPOSITION *p);
-BD_PRIVATE int pg_decode_windows(BITBUFFER *bb, BD_PG_WINDOWS *p);
 
 /*
  * cleanup
  */
 
 BD_PRIVATE void pg_clean_object(BD_PG_OBJECT *p);
-BD_PRIVATE void pg_clean_composition(BD_PG_COMPOSITION *p);
-BD_PRIVATE void pg_clean_windows(BD_PG_WINDOWS *p);
 
+BD_PRIVATE void pg_free_window(BD_PG_WINDOW **p);
 BD_PRIVATE void pg_free_palette(BD_PG_PALETTE **p);
 BD_PRIVATE void pg_free_object(BD_PG_OBJECT **p);
-BD_PRIVATE void pg_free_composition(BD_PG_COMPOSITION **p);
-BD_PRIVATE void pg_free_windows(BD_PG_WINDOWS **p);
 
 #endif // _PG_DECODE_H_
diff --git a/src/libbluray/hdmv/hdmv_vm.c b/src/libbluray/hdmv/hdmv_vm.c
index 6e29235..3453d2f 100644
--- a/src/libbluray/hdmv/hdmv_vm.c
+++ b/src/libbluray/hdmv/hdmv_vm.c
@@ -23,7 +23,6 @@
 #include "hdmv_insn.h"
 #include "../register.h"
 
-#include "../bdnav/index_parse.h"
 #include "util/macro.h"
 #include "util/strutl.h"
 #include "util/logging.h"
@@ -59,9 +58,6 @@ struct hdmv_vm_s {
     /* suspended object */
     MOBJ_OBJECT *suspended_object;
     int          suspended_pc;
-
-    /* disc index (used to verify CALL_TITLE/JUMP_TITLE) */
-    INDX_ROOT   *indx;
 };
 
 /*
@@ -235,7 +231,7 @@ static int _queue_event(HDMV_VM *p, uint32_t event, uint32_t param)
  * vm init
  */
 
-HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs, INDX_ROOT *indx)
+HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs)
 {
     HDMV_VM *p = calloc(1, sizeof(HDMV_VM));
     char *file;
@@ -250,7 +246,6 @@ HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs, INDX_ROOT *indx
     }
 
     p->regs         = regs;
-    p->indx         = indx;
 
     bd_mutex_init(&p->mutex);
 
@@ -283,22 +278,6 @@ void hdmv_vm_free(HDMV_VM **p)
  * suspend/resume ("function call")
  */
 
-static int _suspended_at_play_pl(HDMV_VM *p)
-{
-    int play_pl = 0;
-    if (p && p->suspended_object) {
-        MOBJ_CMD  *cmd  = &p->suspended_object->cmds[p->suspended_pc];
-        HDMV_INSN *insn = &cmd->insn;
-        play_pl = (insn->grp     == INSN_GROUP_BRANCH &&
-                   insn->sub_grp == BRANCH_PLAY  &&
-                   (  insn->branch_opt == INSN_PLAY_PL ||
-                      insn->branch_opt == INSN_PLAY_PL_PI ||
-                      insn->branch_opt == INSN_PLAY_PL_PM));
-    }
-
-    return play_pl;
-}
-
 static void _suspend_object(HDMV_VM *p, int psr_backup)
 {
     BD_DEBUG(DBG_HDMV, "_suspend_object()\n");
@@ -325,8 +304,6 @@ static int _resume_object(HDMV_VM *p, int psr_restore)
         return -1;
     }
 
-    _free_ig_object(p);
-
     p->object = p->suspended_object;
     p->pc     = p->suspended_pc + 1;
 
@@ -346,21 +323,6 @@ static int _resume_object(HDMV_VM *p, int psr_restore)
  * branching
  */
 
-static int _is_valid_title(HDMV_VM *p, int title)
-{
-    if (title == 0 || title == 0xffff) {
-        INDX_PLAY_ITEM *pi = (!title) ? &p->indx->top_menu : &p->indx->first_play;
-
-        if (pi->object_type == indx_object_type_hdmv &&  pi->hdmv.id_ref == 0xffff) {
-            /* no top menu or first play title (5.2.3.3) */
-            return 0;
-        }
-        return 1;
-    }
-
-    return title > 0 && title <= p->indx->num_titles;
-}
-
 static int _jump_object(HDMV_VM *p, int object)
 {
     if (object < 0 || object >= p->movie_objects->num_objects) {
@@ -382,7 +344,7 @@ static int _jump_object(HDMV_VM *p, int object)
 
 static int _jump_title(HDMV_VM *p, int title)
 {
-    if (_is_valid_title(p, title)) {
+    if (title >= 0 && title <= 0xffff) {
         BD_DEBUG(DBG_HDMV, "_jump_title(%d)\n", title);
 
         /* discard suspended object */
@@ -409,7 +371,7 @@ static int _call_object(HDMV_VM *p, int object)
 
 static int _call_title(HDMV_VM *p, int title)
 {
-    if (_is_valid_title(p, title)) {
+    if (title >= 0 && title <= 0xffff) {
         BD_DEBUG(DBG_HDMV, "_call_title(%d)\n", title);
 
         _suspend_object(p, 1);
@@ -1012,28 +974,13 @@ int hdmv_vm_resume(HDMV_VM *p)
     return result;
 }
 
-int hdmv_vm_suspend_pl(HDMV_VM *p)
+int hdmv_vm_suspend(HDMV_VM *p)
 {
     int result = -1;
     bd_mutex_lock(&p->mutex);
 
-    if (p->object || p->ig_object) {
-        BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): HDMV VM is still running\n");
-
-    } else if (!p->suspended_object) {
-        BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): No suspended object\n");
-
-    } else if (!_suspended_at_play_pl(p)) {
-        BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): Object is not playing playlist\n");
-
-    } else if (!p->suspended_object->resume_intention_flag) {
-        BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): no resume intention flag\n");
-
-        p->suspended_object = NULL;
-        result = 0;
-
-    } else {
-        bd_psr_save_state(p->regs);
+    if (p->object && !p->ig_object) {
+        _suspend_object(p, 1);
         result = 0;
     }
 
diff --git a/src/libbluray/hdmv/hdmv_vm.h b/src/libbluray/hdmv/hdmv_vm.h
index f86cf89..9c0d945 100644
--- a/src/libbluray/hdmv/hdmv_vm.h
+++ b/src/libbluray/hdmv/hdmv_vm.h
@@ -58,7 +58,6 @@ typedef struct hdmv_vm_event_s {
  */
 
 struct bd_registers_s;
-struct indx_root_s;
 
 /*
  *
@@ -66,7 +65,7 @@ struct indx_root_s;
 
 typedef struct hdmv_vm_s HDMV_VM;
 
-BD_PRIVATE HDMV_VM *hdmv_vm_init(const char *disc_root, struct bd_registers_s *regs, struct indx_root_s *indx);
+BD_PRIVATE HDMV_VM *hdmv_vm_init(const char *disc_root, struct bd_registers_s *regs);
 BD_PRIVATE void     hdmv_vm_free(HDMV_VM **p);
 
 BD_PRIVATE int      hdmv_vm_select_object(HDMV_VM *p, int object);
@@ -80,35 +79,7 @@ BD_PRIVATE int      hdmv_vm_running(HDMV_VM *p);
 #define HDMV_TITLE_SEARCH_MASK  0x02
 BD_PRIVATE uint32_t hdmv_vm_get_uo_mask(HDMV_VM *p);
 
-/**
- *
- *  Suspend playlist playback
- *
- *  This function assumes playlist is currently playing and
- *  movie object execution is suspended at PLAY_PL instruction.
- *
- *  If resume_intention_flag of current movie object is 1:
- *    Copy playback position PSRs to backup registers
- *    (suspend playlist playback at current position)
- *  If resume_intention_flag of current movie object is 0:
- *    Discard current movie object
- *
- * @param p  HDMV_VM object
- * @return 0 on success, -1 if error
- */
-BD_PRIVATE int      hdmv_vm_suspend_pl(HDMV_VM *p);
-
-/**
- *
- *  Resume HDMV execution
- *
- *  Continue execution of movie object after playlist playback.
- *  Do not restore backup PSRs.
- *  This function is called when playlist playback ends.
- *
- * @param p  HDMV_VM object
- * @return 0 on success, -1 if error
- */
+BD_PRIVATE int      hdmv_vm_suspend(HDMV_VM *p);
 BD_PRIVATE int      hdmv_vm_resume(HDMV_VM *p);
 
 #endif // _HDMV_VM_H_
diff --git a/src/libbluray/register.c b/src/libbluray/register.c
index aec8e89..07032f8 100644
--- a/src/libbluray/register.c
+++ b/src/libbluray/register.c
@@ -268,23 +268,17 @@ void bd_psr_reset_backup_registers(BD_REGISTERS *p)
 
 void bd_psr_restore_state(BD_REGISTERS *p)
 {
-    uint32_t old_psr[13];
-    uint32_t new_psr[13];
+    uint32_t old_psr[BD_PSR_COUNT];
 
     bd_psr_lock(p);
 
-    if (p->num_cb) {
-        memcpy(old_psr, p->psr, sizeof(old_psr[0]) * 13);
-    }
+    if (p->num_cb)
+        memcpy(old_psr, p->psr, sizeof(old_psr));
 
     /* restore backup registers */
     memcpy(p->psr + 4,  p->psr + 36, sizeof(uint32_t) * 5);
     memcpy(p->psr + 10, p->psr + 42, sizeof(uint32_t) * 3);
 
-    if (p->num_cb) {
-        memcpy(new_psr, p->psr, sizeof(new_psr[0]) * 13);
-    }
-
     /* init backup registers to default */
     memcpy(p->psr + 36, bd_psr_init + 36, sizeof(uint32_t) * 5);
     memcpy(p->psr + 42, bd_psr_init + 42, sizeof(uint32_t) * 3);
@@ -297,11 +291,11 @@ void bd_psr_restore_state(BD_REGISTERS *p)
         ev.ev_type = BD_PSR_RESTORE;
 
         for (i = 4; i < 13; i++) {
-            if (i != PSR_NAV_TIMER) {
+            if (i != 9 && old_psr[i] != p->psr[i]) {
 
                 ev.psr_idx = i;
                 ev.old_val = old_psr[i];
-                ev.new_val = new_psr[i];
+                ev.new_val = p->psr[i];
 
                 for (j = 0; j < p->num_cb; j++) {
                     p->cb[j].cb(p->cb[j].handle, &ev);
diff --git a/src/util/bits.h b/src/util/bits.h
index c693aef..1a1b099 100644
--- a/src/util/bits.h
+++ b/src/util/bits.h
@@ -71,12 +71,12 @@ static inline void bs_init( BITSTREAM *bs, BD_FILE_H *fp )
     bb_init(&bs->bb, bs->buf, bs->size);
 }
 
-static inline off_t bb_pos( const BITBUFFER *bb )
+static inline int bb_pos( const BITBUFFER *bb )
 {
     return 8 * ( bb->p - bb->p_start ) + 8 - bb->i_left;
 }
 
-static inline off_t bs_pos( const BITSTREAM *bs )
+static inline int bs_pos( const BITSTREAM *bs )
 {
     return bs->pos * 8 + bb_pos(&bs->bb);
 }
diff --git a/src/util/log_control.h b/src/util/log_control.h
index abbdb4d..f413dd2 100644
--- a/src/util/log_control.h
+++ b/src/util/log_control.h
@@ -21,10 +21,6 @@
 #ifndef BD_LOG_CONTROL_H_
 #define BD_LOG_CONTROL_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <stdint.h>
 
 
@@ -61,8 +57,5 @@ void bd_set_debug_handler(BD_LOG_FUNC);
 void bd_set_debug_mask(uint32_t mask);
 uint32_t bd_get_debug_mask(void);
 
-#ifdef __cplusplus
-};
-#endif
 
 #endif /* BD_LOG_CONTROL_H_ */
diff --git a/src/util/strutl.c b/src/util/strutl.c
index 8330280..acc4b06 100644
--- a/src/util/strutl.c
+++ b/src/util/strutl.c
@@ -22,7 +22,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
-#include <ctype.h>
 
 char * str_printf(const char *fmt, ...)
 {
@@ -79,11 +78,3 @@ uint32_t str_to_uint32(const char *s, int n)
 
     return val;
 }
-
-void str_tolower(char *s)
-{
-    while (*s) {
-        *s = tolower(*s);
-        s++;
-    }
-}
diff --git a/src/util/strutl.h b/src/util/strutl.h
index 4e87b4f..aa00095 100644
--- a/src/util/strutl.h
+++ b/src/util/strutl.h
@@ -27,6 +27,5 @@
 BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD_ATTR_MALLOC;
 
 BD_PRIVATE uint32_t str_to_uint32(const char *s, int n);
-BD_PRIVATE void     str_tolower(char *s);
 
 #endif // STRUTL_H_

-- 
libbluray packaging



More information about the pkg-multimedia-commits mailing list