diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2001-06-17 21:50:51 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2001-06-17 21:50:51 +0000 |
commit | 10cc2ced3a641f27cb18a123a987327d6959bd40 (patch) | |
tree | 7fc1e704541d0a51b913be33ba1cf067b8874e08 | |
parent | 1d62c233da06a4a1c110c81a854de335bda8d397 (diff) | |
download | xine-lib-10cc2ced3a641f27cb18a123a987327d6959bd40.tar.gz xine-lib-10cc2ced3a641f27cb18a123a987327d6959bd40.tar.bz2 |
Add a clean aalib check.
CVS patchset: 202
CVS date: 2001/06/17 21:50:51
-rw-r--r-- | configure.in | 8 | ||||
-rwxr-xr-x | cvscompile.sh | 2 | ||||
-rw-r--r-- | m4/Makefile.am | 2 | ||||
-rw-r--r-- | m4/aa.m4 | 209 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 11 |
5 files changed, 223 insertions, 9 deletions
diff --git a/configure.in b/configure.in index 6251d77dc..b4c6d5c66 100644 --- a/configure.in +++ b/configure.in @@ -197,12 +197,8 @@ AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes") dnl dnl Checks for Ascii-Art library dnl - -AC_CHECK_LIB(aa, main, - AC_DEFINE(HAVE_AA) - ac_have_aa="yes",,) -AM_CONDITIONAL(HAVE_AA, test x$ac_have_aa = "xyes") - +AM_PATH_AALIB(1.2,,) +AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes") dnl dnl Alsa support diff --git a/cvscompile.sh b/cvscompile.sh index d671af41c..a19d28097 100755 --- a/cvscompile.sh +++ b/cvscompile.sh @@ -1,7 +1,7 @@ #!/bin/sh # Run this to generate all the initial Makefiles, etc. -m4_files="_xine.m4 alsa.m4 esd.m4" +m4_files="_xine.m4 alsa.m4 esd.m4 aa.m4" if test -d m4; then rm -f acinclude.m4 for m4f in $m4_files; do diff --git a/m4/Makefile.am b/m4/Makefile.am index feb4e645d..90630dcee 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -6,7 +6,7 @@ m4datadir = @ACLOCAL_DIR@ m4data_DATA = xine.m4 endif -EXTRA_DIST = _xine.m4 alsa.m4 esd.m4 xine.m4 +EXTRA_DIST = _xine.m4 alsa.m4 esd.m4 xine.m4 aa.m4 debug: diff --git a/m4/aa.m4 b/m4/aa.m4 new file mode 100644 index 000000000..76cb70e01 --- /dev/null +++ b/m4/aa.m4 @@ -0,0 +1,209 @@ +dnl Configure path and dependencies for aalib. +dnl +dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a configuration +dnl script generated by Autoconf, you may include it under the same +dnl distribution terms that you use for the rest of that program. +dnl +dnl AM_PATH_AALIB([MINIMUM-VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND ]]]) +dnl Test for AALIB, and define AALIB_CFLAGS and AALIB_LIBS, AALIB_STATIC_LIBS. +dnl +dnl *********************** +dnl 17/06/2001 +dnl * First shot +dnl +AC_DEFUN(AM_PATH_AALIB, +[dnl +dnl +AC_ARG_WITH(aalib-prefix, + [ --with-aalib-prefix=PFX Prefix where AALIB is installed (optional)], + aalib_prefix="$withval", aalib_prefix="") + +AC_ARG_ENABLE(aalib-test, + [ --disable-aalibtest Do not try to compile and run a test AALIB program],, enable_aalibtest=yes) + + if test x$aalib_prefix != x; then + aalib_aainfo="$aalib_prefix/bin/aainfo" + AALIB_CFLAGS="-I$aalib_prefix/include" + AALIB_LIBS="-L$aalib_prefix/lib -laa" + else + aalib_aainfo="aainfo" + AALIB_LIBS="-laa" + fi + + AALIB_STATIC_LIBS="$AALIB_LIBS" + + min_aalib_version=ifelse([$1], ,1.2,$1) + + if test x"$enable_aalibtest" != "xyes"; then + AC_MSG_CHECKING(for AALIB version >= $min_aalib_version) + else + if test x"$aalib_prefix" = "x"; then + AC_PATH_PROG(aalib_aainfo, aainfo, no) + else + AC_MSG_CHECKING(for $aalib_aainfo) + if test -x $aalib_aainfo; then + AC_MSG_RESULT(yes) + else + aalib_aainfo="no" + AC_MSG_RESULT(no) + fi + fi + + AC_MSG_CHECKING(for AALIB version >= $min_aalib_version) + no_aalib="" + + if test x"$aalib_aainfo" = "xno"; then + no_aalib=yes + else + aalib_drivers="`$aalib_aainfo --help | grep drivers | sed -e 's/available//g;s/drivers//g;s/\://g'`" + for drv in $aalib_drivers; do + if test $drv = "X11" -a x$x11dep = "x"; then + AALIB_STATIC_LIBS="$AALIB_STATIC_LIBS -lX11" + AALIB_CFLAGS="$AALIB_CFLAGS `echo $X_CFLAGS|sed -e 's/\-I/\-L/g;s/include/lib/g'`" + x11dep="yes" + fi + if test $drv = "slang" -a x$slangdep = "x"; then + AALIB_STATIC_LIBS="$AALIB_STATIC_LIBS -lslang" + slangdep="yes" + fi + if test $drv = "gpm" -a x$gmpdep = "x"; then + AALIB_STATIC_LIBS="$AALIB_STATIC_LIBS -lgpm" + gpmdep="yes" + fi + done + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$AALIB_CFLAGS $CFLAGS" + LIBS="$AALIB_LIBS $LIBS" + +dnl +dnl Now check if the installed AALIB is sufficiently new. (Also sanity +dnl checks the results of xine-config to some extent +dnl + AC_LANG_SAVE() + AC_LANG_C() + rm -f conf.xinetest + AC_TRY_RUN([ +#include <stdio.h> +#include <stdlib.h> +#include <aalib.h> + +int main () { + int major, minor; + char *tmp_version; + + system ("touch conf.xinetest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = (char *) strdup("$min_aalib_version"); + if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) { + printf("%s, bad version string\n", "$min_aalib_version"); + exit(1); + } + + if ((AA_LIB_VERSION > major) || ((AA_LIB_VERSION == major) && +#ifdef AA_LIB_MINNOR + (AA_LIB_MINNOR >= minor) +#else + (AA_LIB_MINOR >= minor) +#endif + )) { + return 0; + } + else { + printf("\n*** An old version of AALIB (%d.%d) was found.\n", + AA_LIB_VERSION, +#ifdef AA_LIB_MINNOR + AA_LIB_MINNOR +#else + AA_LIB_MINOR +#endif + ); + printf("*** You need a version of AALIB newer than %d.%d. The latest version of\n", major, minor); + printf("*** AALIB is always available from:\n"); + printf("*** http://www.ta.jcu.cz://aa\n"); + printf("***\n"); + } + return 1; +} +],, no_aalib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_aalib" = x; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$aalib_aainfo" = "no"; then + echo "*** The aainfo program installed by AALIB could not be found" + echo "*** If AALIB was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or use --with-aalib-prefix to set the prefix" + echo "*** where AALIB is installed." + else + if test -f conf.xinetest ; then + : + else + echo "*** Could not run AALIB test program, checking why..." + CFLAGS="$CFLAGS $AALIB_CFLAGS" + LIBS="$LIBS $AALIB_LIBS" + AC_TRY_LINK([ +#include <stdio.h> +#include <aalib.h> +], [ + return ((AA_LIB_VERSION) || +#ifdef AA_LIB_MINNOR + (AA_LIB_MINNOR) +#else + (AA_LIB_MINOR) +#endif + ); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding AALIB or finding the wrong" + echo "*** version of AALIB. If it is not finding AALIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means AALIB was incorrectly installed" + echo "*** or that you have moved AALIB since it was installed." ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + AALIB_CFLAGS="" + AALIB_LIBS="" + AALIB_STATIC_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(AALIB_CFLAGS) + AC_SUBST(AALIB_LIBS) + AC_SUBST(AALIB_STATIC_LIBS) + AC_LANG_RESTORE() + rm -f conf.xinetest +]) + diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 9105444be..30c69f6ee 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg_block.c,v 1.17 2001/06/17 00:23:34 guenter Exp $ + * $Id: demux_mpeg_block.c,v 1.18 2001/06/17 21:50:51 f1rmb Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -510,6 +510,15 @@ static int demux_mpeg_block_open(demux_plugin_t *this_gen, input->seek(input, 0, SEEK_SET); if (input->read(input, buf, this->blocksize)) { + + { + int i=0,j=0; + + while(i<this->blocksize) { + if(buf[i] && !j) {printf("***%d\n", i); j++;} + i++; + } + } if(buf[0] || buf[1] || (buf[2] != 0x01) || (buf[3] != 0xba)) return DEMUX_CANNOT_HANDLE; |