Commit 4b921617 authored by Sam Hocevar's avatar Sam Hocevar

  * DirectX enhancements by Gildas Bazin, such as software rendering.
  * Merged dvdcss_init and dvdcss_open into dvdcss_open, and dvdcss_close
    and dvdcss_end into dvdcss_close. libdvdcss API now has 7 functions.
  * Another failed attempt at profiling vlc under Linux: ported the
    threads API to GNU Pth. Activate with --enable-pth. It doesn't seem to
    spawn new threads for me, maybe someone will have better luck.
  * Makefile optimizations.
  * Automatic build of libdvdcss if not found.
parent 322cfc68
...@@ -11,109 +11,43 @@ ...@@ -11,109 +11,43 @@
# #
# All possible plugin directories, needed for make clean # All possible plugin directories, needed for make clean
# #
PLUGINS_DIR := alsa beos darwin directx dsp dummy \ PLUGINS_DIR := alsa beos darwin directx dsp dummy dvd esd fb ggi glide gtk downmix idct imdct macosx mga motion mpeg qt sdl text x11 yuv
dvd esd fb ggi glide gtk \
downmix idct imdct \
macosx mga \
motion \
mpeg qt sdl \
text x11 yuv
# #
# All possible plugin objects # All possible plugin objects
# #
PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin directx/directx \ PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin directx/directx dsp/dsp dummy/dummy dummy/null dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gtk/gnome gtk/gtk downmix/downmix downmix/downmixsse downmix/downmix3dn idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext imdct/imdct imdct/imdct3dn imdct/imdctsse macosx/macosx mga/mga motion/motion motion/motionmmx motion/motionmmxext mpeg/es mpeg/ps mpeg/ts qt/qt sdl/sdl text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
dsp/dsp dummy/dummy dummy/null dvd/dvd esd/esd fb/fb \
ggi/ggi glide/glide gtk/gnome gtk/gtk \
downmix/downmix downmix/downmixsse downmix/downmix3dn \
idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
imdct/imdct imdct/imdct3dn imdct/imdctsse \
macosx/macosx mga/mga \
motion/motion motion/motionmmx motion/motionmmxext \
mpeg/es mpeg/ps mpeg/ts qt/qt sdl/sdl \
text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
# #
# C Objects # C Objects
# #
INTERFACE := src/interface/main.o \ INTERFACE := main interface intf_msg intf_playlist intf_channels
src/interface/interface.o \ INPUT := input input_ext-dec input_ext-intf input_dec input_programs input_netlist input_clock mpeg_system
src/interface/intf_msg.o \ VIDEO_OUTPUT := video_output video_text video_spu video_yuv
src/interface/intf_playlist.o \ AUDIO_OUTPUT := audio_output aout_ext-dec aout_u8 aout_s8 aout_u16 aout_s16 aout_spdif
src/interface/intf_channels.o AC3_DECODER := ac3_decoder_thread ac3_decoder ac3_parse ac3_exponent ac3_bit_allocate ac3_mantissa ac3_rematrix ac3_imdct
AC3_SPDIF := ac3_spdif ac3_iec958
INPUT := src/input/input.o \ LPCM_DECODER := lpcm_decoder_thread
src/input/input_ext-dec.o \ AUDIO_DECODER := audio_decoder adec_generic adec_layer1 adec_layer2 adec_math
src/input/input_ext-intf.o \ SPU_DECODER := spu_decoder
src/input/input_dec.o \ #GEN_DECODER := generic_decoder
src/input/input_programs.o \ VIDEO_PARSER := video_parser vpar_headers vpar_blocks vpar_synchro video_fifo
src/input/input_netlist.o \ VIDEO_DECODER := video_decoder
src/input/input_clock.o \ MISC := mtime tests modules netutils
src/input/mpeg_system.o
C_OBJ := $(INTERFACE:%=src/interface/%.o) \
AUDIO_OUTPUT := src/audio_output/audio_output.o \ $(INPUT:%=src/input/%.o) \
src/audio_output/aout_ext-dec.o \ $(VIDEO_OUTPUT:%=src/video_output/%.o) \
src/audio_output/aout_u8.o \ $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
src/audio_output/aout_s8.o \ $(AC3_DECODER:%=src/ac3_decoder/%.o) \
src/audio_output/aout_u16.o \ $(AC3_SPDIF:%=src/ac3_spdif/%.o) \
src/audio_output/aout_s16.o \ $(LPCM_DECODER:%=src/lpcm_decoder/%.o) \
src/audio_output/aout_spdif.o $(AUDIO_DECODER:%=src/audio_decoder/%.o) \
$(SPU_DECODER:%=src/spu_decoder/%.o) \
VIDEO_OUTPUT := src/video_output/video_output.o \ $(GEN_DECODER:%=src/generic_decoder/%.o) \
src/video_output/video_text.o \ $(VIDEO_PARSER:%=src/video_parser/%.o) \
src/video_output/video_spu.o \ $(VIDEO_DECODER:%=src/video_decoder/%.o) \
src/video_output/video_yuv.o $(MISC:%=src/misc/%.o)
AC3_DECODER := src/ac3_decoder/ac3_decoder_thread.o \
src/ac3_decoder/ac3_decoder.o \
src/ac3_decoder/ac3_parse.o \
src/ac3_decoder/ac3_exponent.o \
src/ac3_decoder/ac3_bit_allocate.o \
src/ac3_decoder/ac3_mantissa.o \
src/ac3_decoder/ac3_rematrix.o \
src/ac3_decoder/ac3_imdct.o
AC3_SPDIF := src/ac3_spdif/ac3_spdif.o \
src/ac3_spdif/ac3_iec958.o
LPCM_DECODER := src/lpcm_decoder/lpcm_decoder_thread.o \
AUDIO_DECODER := src/audio_decoder/audio_decoder.o \
src/audio_decoder/adec_generic.o \
src/audio_decoder/adec_layer1.o \
src/audio_decoder/adec_layer2.o \
src/audio_decoder/adec_math.o
SPU_DECODER := src/spu_decoder/spu_decoder.o
#GEN_DECODER := src/generic_decoder/generic_decoder.o
VIDEO_PARSER := src/video_parser/video_parser.o \
src/video_parser/vpar_headers.o \
src/video_parser/vpar_blocks.o \
src/video_parser/vpar_synchro.o \
src/video_parser/video_fifo.o
VIDEO_DECODER := src/video_decoder/video_decoder.o
MISC := src/misc/mtime.o \
src/misc/tests.o \
src/misc/modules.o \
src/misc/netutils.o
C_OBJ := $(INTERFACE) \
$(INPUT) \
$(VIDEO_OUTPUT) \
$(AUDIO_OUTPUT) \
$(AC3_DECODER) \
$(AC3_SPDIF) \
$(LPCM_DECODER) \
$(AUDIO_DECODER) \
$(SPU_DECODER) \
$(GEN_DECODER) \
$(VIDEO_PARSER) \
$(VIDEO_DECODER) \
$(MISC)
# #
# Misc Objects # Misc Objects
...@@ -163,13 +97,21 @@ export ...@@ -163,13 +97,21 @@ export
# #
all: vlc ${ALIASES} plugins vlc.app all: vlc ${ALIASES} plugins vlc.app
clean: clean: libdvdcss-clean plugins-clean vlc-clean
rm -f src/*/*.o extras/*/*.o
rm -f lib/*.so lib/*.so.* lib/*.a
libdvdcss-clean:
cd extras/libdvdcss && $(MAKE) clean
plugins-clean:
for dir in $(PLUGINS_DIR) ; do \ for dir in $(PLUGINS_DIR) ; do \
( cd plugins/$${dir} && $(MAKE) clean ) ; done ( cd plugins/$${dir} && $(MAKE) clean ) ; done
rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak
vlc-clean:
rm -f $(C_OBJ) $(CPP_OBJ) rm -f $(C_OBJ) $(CPP_OBJ)
rm -f src/*/*.o extras/*/*.o rm -f vlc gnome-vlc gvlc kvlc qvlc
rm -f lib/*.so lib/*.a vlc gnome-vlc gvlc kvlc qvlc
rm -Rf vlc.app rm -Rf vlc.app
distclean: clean distclean: clean
...@@ -182,21 +124,28 @@ distclean: clean ...@@ -182,21 +124,28 @@ distclean: clean
rm -Rf .dep rm -Rf .dep
rm -f .gdb_history rm -f .gdb_history
install: install: libdvdcss-install vlc-install plugins-install
vlc-install:
mkdir -p $(DESTDIR)$(bindir) mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) vlc $(DESTDIR)$(bindir) $(INSTALL) vlc $(DESTDIR)$(bindir)
ifneq (,$(ALIASES)) ifneq (,$(ALIASES))
for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
endif
mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
ifneq (,$(PLUGINS))
$(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
endif endif
mkdir -p $(DESTDIR)$(datadir)/videolan mkdir -p $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
plugins-install:
mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
ifneq (,$(PLUGINS))
$(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
endif
libdvdcss-install:
cd extras/libdvdcss && $(MAKE) install
show: show:
@echo CC: $(CC) @echo CC: $(CC)
@echo CFLAGS: $(CFLAGS) @echo CFLAGS: $(CFLAGS)
......
...@@ -55,6 +55,7 @@ prefix = @prefix@ ...@@ -55,6 +55,7 @@ prefix = @prefix@
bindir = @bindir@ bindir = @bindir@
datadir = @datadir@ datadir = @datadir@
libdir = @libdir@ libdir = @libdir@
includedir = @includedir@
# #
# Libraries for special cases # Libraries for special cases
...@@ -87,6 +88,11 @@ CFLAGS_GTK = @CFLAGS_GTK@ ...@@ -87,6 +88,11 @@ CFLAGS_GTK = @CFLAGS_GTK@
CFLAGS_SDL = @CFLAGS_SDL@ CFLAGS_SDL = @CFLAGS_SDL@
CFLAGS_X11 = @CFLAGS_X11@ CFLAGS_X11 = @CFLAGS_X11@
#
# Other special cases
#
LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
############################################################################### ###############################################################################
# Configuration pre-processing # Configuration pre-processing
############################################################################### ###############################################################################
...@@ -140,22 +146,28 @@ endif ...@@ -140,22 +146,28 @@ endif
INCLUDE += @INCLUDE@ INCLUDE += @INCLUDE@
INCLUDE += -Iinclude -Iextras -I/usr/local/include INCLUDE += -Iinclude -Iextras -I/usr/local/include
#
# Libraries needed by built-in modules
#
ifneq (,$(BUILTINS))
LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
LIB += $(LIB_BUILTINS)
endif
# #
# Libraries # Libraries
# #
LIB += @LIB@ -L/usr/local/lib ifeq (1,$(LOCAL_LIBDVDCSS))
ifneq (,$(findstring dvd,$(BUILTINS)))
LIB += lib/libdvdcss.a
endif
endif
ifneq (,$(findstring mingw32,$(SYS))) ifneq (,$(findstring mingw32,$(SYS)))
LIB += -lws2_32 -lnetapi32 LIB += -lws2_32 -lnetapi32
endif endif
# LIB += -L/usr/local/lib @LIB@
# Libraries needed by built-in modules
#
ifneq (,$(BUILTINS))
LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
LIB += $(LIB_BUILTINS)
endif
# #
# C compiler flags: mainstream compilation # C compiler flags: mainstream compilation
......
...@@ -12,11 +12,7 @@ ac_help= ...@@ -12,11 +12,7 @@ ac_help=
ac_default_prefix=/usr/local ac_default_prefix=/usr/local
# Any additions from configure.in: # Any additions from configure.in:
ac_help="$ac_help ac_help="$ac_help
--disable-dummy dummy module (default enabled)" --enable-pth Enable GNU Pth support (default disabled)"
ac_help="$ac_help
--disable-null Null module (default enabled)"
ac_help="$ac_help
--disable-rc rc module (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--disable-ppro Disable PentiumPro optimizations (default enabled for x86)" --disable-ppro Disable PentiumPro optimizations (default enabled for x86)"
ac_help="$ac_help ac_help="$ac_help
...@@ -33,6 +29,12 @@ ac_help="$ac_help ...@@ -33,6 +29,12 @@ ac_help="$ac_help
--enable-trace Enable trace mode (default disabled)" --enable-trace Enable trace mode (default disabled)"
ac_help="$ac_help ac_help="$ac_help
--disable-optimizations Disable compiler optimizations (default enabled)" --disable-optimizations Disable compiler optimizations (default enabled)"
ac_help="$ac_help
--disable-dummy dummy module (default enabled)"
ac_help="$ac_help
--disable-null Null module (default enabled)"
ac_help="$ac_help
--disable-rc rc module (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--disable-dsp Linux /dev/dsp support (default enabled)" --disable-dsp Linux /dev/dsp support (default enabled)"
ac_help="$ac_help ac_help="$ac_help
...@@ -605,7 +607,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } ...@@ -605,7 +607,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi fi
echo $ac_n "checking host system type""... $ac_c" 1>&6 echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:609: checking host system type" >&5 echo "configure:611: checking host system type" >&5
host_alias=$host host_alias=$host
case "$host_alias" in case "$host_alias" in
...@@ -634,7 +636,7 @@ VLC_CODENAME=Ourumov ...@@ -634,7 +636,7 @@ VLC_CODENAME=Ourumov
save_CFLAGS="${CFLAGS}" save_CFLAGS="${CFLAGS}"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:638: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo "configure:640: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -663,7 +665,7 @@ fi ...@@ -663,7 +665,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args. # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2 set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:667: checking for $ac_word" >&5 echo "configure:669: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -693,7 +695,7 @@ if test -z "$CC"; then ...@@ -693,7 +695,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args. # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2 set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:697: checking for $ac_word" >&5 echo "configure:699: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -744,7 +746,7 @@ fi ...@@ -744,7 +746,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args. # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2 set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:748: checking for $ac_word" >&5 echo "configure:750: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -776,7 +778,7 @@ fi ...@@ -776,7 +778,7 @@ fi
fi fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:780: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 echo "configure:782: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
...@@ -787,12 +789,12 @@ cross_compiling=$ac_cv_prog_cc_cross ...@@ -787,12 +789,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 791 "configure" #line 793 "configure"
#include "confdefs.h" #include "confdefs.h"
main(){return(0);} main(){return(0);}
EOF EOF
if { (eval echo configure:796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler. # If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then if (./conftest; exit) 2>/dev/null; then
...@@ -818,12 +820,12 @@ if test $ac_cv_prog_cc_works = no; then ...@@ -818,12 +820,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:822: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "configure:824: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:827: checking whether we are using GNU C" >&5 echo "configure:829: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -832,7 +834,7 @@ else ...@@ -832,7 +834,7 @@ else
yes; yes;
#endif #endif
EOF EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes ac_cv_prog_gcc=yes
else else
ac_cv_prog_gcc=no ac_cv_prog_gcc=no
...@@ -851,7 +853,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ...@@ -851,7 +853,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS" ac_save_CFLAGS="$CFLAGS"
CFLAGS= CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:855: checking whether ${CC-cc} accepts -g" >&5 echo "configure:857: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -883,7 +885,7 @@ else ...@@ -883,7 +885,7 @@ else
fi fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:887: checking how to run the C preprocessor" >&5 echo "configure:889: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory. # On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then if test -n "$CPP" && test -d "$CPP"; then
CPP= CPP=
...@@ -898,13 +900,13 @@ else ...@@ -898,13 +900,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser, # On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. # not just through cpp.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 902 "configure" #line 904 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -915,13 +917,13 @@ else ...@@ -915,13 +917,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 919 "configure" #line 921 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -932,13 +934,13 @@ else ...@@ -932,13 +934,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -nologo -E" CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 936 "configure" #line 938 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -965,7 +967,7 @@ echo "$ac_t""$CPP" 1>&6 ...@@ -965,7 +967,7 @@ echo "$ac_t""$CPP" 1>&6
# Extract the first word of "ranlib", so it can be a program name with args. # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2 set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:969: checking for $ac_word" >&5 echo "configure:971: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -1005,7 +1007,7 @@ fi ...@@ -1005,7 +1007,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1009: checking for a BSD compatible install" >&5 echo "configure:1011: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1059,12 +1061,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ...@@ -1059,12 +1061,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking for working const""... $ac_c" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:1063: checking for working const" >&5 echo "configure:1065: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1068 "configure" #line 1070 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
...@@ -1113,7 +1115,7 @@ ccp = (char const *const *) p; ...@@ -1113,7 +1115,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
...@@ -1136,14 +1138,14 @@ fi ...@@ -1136,14 +1138,14 @@ fi
if test x${cross_compiling} != xyes; then if test x${cross_compiling} != xyes; then
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:1140: checking whether byte ordering is bigendian" >&5 echo "configure:1142: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_cv_c_bigendian=unknown ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro. # See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1147 "configure" #line 1149 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
...@@ -1154,11 +1156,11 @@ int main() { ...@@ -1154,11 +1156,11 @@ int main() {
#endif #endif
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not. # It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1162 "configure" #line 1164 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
...@@ -1169,7 +1171,7 @@ int main() { ...@@ -1169,7 +1171,7 @@ int main() {
#endif #endif
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_bigendian=yes ac_cv_c_bigendian=yes
else else
...@@ -1189,7 +1191,7 @@ if test "$cross_compiling" = yes; then ...@@ -1189,7 +1191,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1193 "configure" #line 1195 "configure"
#include "confdefs.h" #include "confdefs.h"
main () { main () {
/* Are we little or big endian? From Harbison&Steele. */ /* Are we little or big endian? From Harbison&Steele. */
...@@ -1202,7 +1204,7 @@ main () { ...@@ -1202,7 +1204,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1); exit (u.c[sizeof (long) - 1] == 1);
} }
EOF EOF
if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:1208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
ac_cv_c_bigendian=no ac_cv_c_bigendian=no
else else
...@@ -1230,12 +1232,12 @@ fi ...@@ -1230,12 +1232,12 @@ fi
for ac_func in gettimeofday select strerror strtod strtol for ac_func in gettimeofday select strerror strtod strtol
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1234: checking for $ac_func" >&5 echo "configure:1236: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1239 "configure" #line 1241 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
...@@ -1258,7 +1260,7 @@ $ac_func(); ...@@ -1258,7 +1260,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
...@@ -1285,12 +1287,12 @@ done ...@@ -1285,12 +1287,12 @@ done
for ac_func in setenv putenv for ac_func in setenv putenv
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1289: checking for $ac_func" >&5 echo "configure:1291: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1294 "configure" #line 1296 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
...@@ -1313,7 +1315,7 @@ $ac_func(); ...@@ -1313,7 +1315,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
...@@ -1338,12 +1340,12 @@ fi ...@@ -1338,12 +1340,12 @@ fi
done done
echo $ac_n "checking for connect""... $ac_c" 1>&6 echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:1342: checking for connect" >&5 echo "configure:1344: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1347 "configure" #line 1349 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */ which can conflict with char connect(); below. */
...@@ -1366,7 +1368,7 @@ connect(); ...@@ -1366,7 +1368,7 @@ connect();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_connect=yes" eval "ac_cv_func_connect=yes"
else else
...@@ -1385,7 +1387,7 @@ else ...@@ -1385,7 +1387,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:1389: checking for connect in -lsocket" >&5 echo "configure:1391: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1393,7 +1395,7 @@ else ...@@ -1393,7 +1395,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS" LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1397 "configure" #line 1399 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -1404,7 +1406,7 @@ int main() { ...@@ -1404,7 +1406,7 @@ int main() {
connect() connect()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -1428,12 +1430,12 @@ fi ...@@ -1428,12 +1430,12 @@ fi
fi fi
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:1432: checking for gethostbyname" >&5 echo "configure:1434: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1437 "configure" #line 1439 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */ which can conflict with char gethostbyname(); below. */
...@@ -1456,7 +1458,7 @@ gethostbyname(); ...@@ -1456,7 +1458,7 @@ gethostbyname();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes" eval "ac_cv_func_gethostbyname=yes"
else else
...@@ -1475,7 +1477,7 @@ else ...@@ -1475,7 +1477,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:1479: checking for gethostbyname in -lnsl" >&5 echo "configure:1481: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1483,7 +1485,7 @@ else ...@@ -1483,7 +1485,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS" LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1487 "configure" #line 1489 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -1494,7 +1496,7 @@ int main() { ...@@ -1494,7 +1496,7 @@ int main() {
gethostbyname() gethostbyname()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -1518,12 +1520,12 @@ fi ...@@ -1518,12 +1520,12 @@ fi
fi fi
echo $ac_n "checking for nanosleep""... $ac_c" 1>&6 echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
echo "configure:1522: checking for nanosleep" >&5 echo "configure:1524: checking for nanosleep" >&5
if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1527 "configure" #line 1529 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char nanosleep(); below. */ which can conflict with char nanosleep(); below. */
...@@ -1546,7 +1548,7 @@ nanosleep(); ...@@ -1546,7 +1548,7 @@ nanosleep();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_nanosleep=yes" eval "ac_cv_func_nanosleep=yes"
else else
...@@ -1565,7 +1567,7 @@ else ...@@ -1565,7 +1567,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6 echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
echo "configure:1569: checking for nanosleep in -lrt" >&5 echo "configure:1571: checking for nanosleep in -lrt" >&5
ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'` ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1573,7 +1575,7 @@ else ...@@ -1573,7 +1575,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS" LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1577 "configure" #line 1579 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -1584,7 +1586,7 @@ int main() { ...@@ -1584,7 +1586,7 @@ int main() {
nanosleep() nanosleep()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -1604,7 +1606,7 @@ else ...@@ -1604,7 +1606,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6 echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
echo "configure:1608: checking for nanosleep in -lposix4" >&5 echo "configure:1610: checking for nanosleep in -lposix4" >&5
ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'` ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1612,7 +1614,7 @@ else ...@@ -1612,7 +1614,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS" LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1616 "configure" #line 1618 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -1623,7 +1625,7 @@ int main() { ...@@ -1623,7 +1625,7 @@ int main() {
nanosleep() nanosleep()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -1652,12 +1654,12 @@ fi ...@@ -1652,12 +1654,12 @@ fi
for ac_func in usleep for ac_func in usleep
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1656: checking for $ac_func" >&5 echo "configure:1658: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1661 "configure" #line 1663 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
...@@ -1680,7 +1682,7 @@ $ac_func(); ...@@ -1680,7 +1682,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
...@@ -1705,12 +1707,12 @@ fi ...@@ -1705,12 +1707,12 @@ fi
done done
echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
echo "configure:1709: checking for inet_aton" >&5 echo "configure:1711: checking for inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1714 "configure" #line 1716 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_aton(); below. */ which can conflict with char inet_aton(); below. */
...@@ -1733,7 +1735,7 @@ inet_aton(); ...@@ -1733,7 +1735,7 @@ inet_aton();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_inet_aton=yes" eval "ac_cv_func_inet_aton=yes"
else else
...@@ -1752,7 +1754,7 @@ else ...@@ -1752,7 +1754,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
echo "configure:1756: checking for inet_aton in -lresolv" >&5 echo "configure:1758: checking for inet_aton in -lresolv" >&5
ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1760,7 +1762,7 @@ else ...@@ -1760,7 +1762,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS" LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1764 "configure" #line 1766 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -1771,7 +1773,7 @@ int main() { ...@@ -1771,7 +1773,7 @@ int main() {
inet_aton() inet_aton()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -1797,12 +1799,12 @@ fi ...@@ -1797,12 +1799,12 @@ fi
for ac_func in vasprintf for ac_func in vasprintf
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1801: checking for $ac_func" >&5 echo "configure:1803: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1806 "configure" #line 1808 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
...@@ -1825,7 +1827,7 @@ $ac_func(); ...@@ -1825,7 +1827,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
...@@ -1852,12 +1854,68 @@ done ...@@ -1852,12 +1854,68 @@ done
for ac_func in swab for ac_func in swab
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1856: checking for $ac_func" >&5 echo "configure:1858: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1863 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
for ac_func in sigrelse
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1914: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1861 "configure" #line 1919 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
...@@ -1880,7 +1938,7 @@ $ac_func(); ...@@ -1880,7 +1938,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
...@@ -1906,12 +1964,12 @@ done ...@@ -1906,12 +1964,12 @@ done
echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
echo "configure:1910: checking for getopt_long" >&5 echo "configure:1968: checking for getopt_long" >&5
if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1915 "configure" #line 1973 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getopt_long(); below. */ which can conflict with char getopt_long(); below. */
...@@ -1934,7 +1992,7 @@ getopt_long(); ...@@ -1934,7 +1992,7 @@ getopt_long();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_getopt_long=yes" eval "ac_cv_func_getopt_long=yes"
else else
...@@ -1956,7 +2014,7 @@ else ...@@ -1956,7 +2014,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
# FreeBSD has a gnugetopt library for this: # FreeBSD has a gnugetopt library for this:
echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6 echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
echo "configure:1960: checking for getopt_long in -lgnugetopt" >&5 echo "configure:2018: checking for getopt_long in -lgnugetopt" >&5
ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'` ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1964,7 +2022,7 @@ else ...@@ -1964,7 +2022,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lgnugetopt $LIBS" LIBS="-lgnugetopt $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1968 "configure" #line 2026 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -1975,7 +2033,7 @@ int main() { ...@@ -1975,7 +2033,7 @@ int main() {
getopt_long() getopt_long()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2007,17 +2065,17 @@ for ac_hdr in unistd.h ...@@ -2007,17 +2065,17 @@ for ac_hdr in unistd.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2011: checking for $ac_hdr" >&5 echo "configure:2069: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2016 "configure" #line 2074 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2046,12 +2104,12 @@ done ...@@ -2046,12 +2104,12 @@ done
for ac_func in getpagesize for ac_func in getpagesize
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2050: checking for $ac_func" >&5 echo "configure:2108: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2055 "configure" #line 2113 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
...@@ -2074,7 +2132,7 @@ $ac_func(); ...@@ -2074,7 +2132,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
...@@ -2099,7 +2157,7 @@ fi ...@@ -2099,7 +2157,7 @@ fi
done done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:2103: checking for working mmap" >&5 echo "configure:2161: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -2107,7 +2165,7 @@ else ...@@ -2107,7 +2165,7 @@ else
ac_cv_func_mmap_fixed_mapped=no ac_cv_func_mmap_fixed_mapped=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2111 "configure" #line 2169 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test. /* Thanks to Mike Haertel and Jim Avera for this test.
...@@ -2247,7 +2305,7 @@ main() ...@@ -2247,7 +2305,7 @@ main()
} }
EOF EOF
if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_mmap_fixed_mapped=yes
else else
...@@ -2270,12 +2328,12 @@ EOF ...@@ -2270,12 +2328,12 @@ EOF
fi fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:2274: checking return type of signal handlers" >&5 echo "configure:2332: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2279 "configure" #line 2337 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
...@@ -2292,7 +2350,7 @@ int main() { ...@@ -2292,7 +2350,7 @@ int main() {
int i; int i;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_type_signal=void ac_cv_type_signal=void
else else
...@@ -2311,7 +2369,7 @@ EOF ...@@ -2311,7 +2369,7 @@ EOF
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:2315: checking for dlopen in -ldl" >&5 echo "configure:2373: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2319,7 +2377,7 @@ else ...@@ -2319,7 +2377,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2323 "configure" #line 2381 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2330,7 +2388,7 @@ int main() { ...@@ -2330,7 +2388,7 @@ int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2351,7 +2409,7 @@ else ...@@ -2351,7 +2409,7 @@ else
fi fi
echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
echo "configure:2355: checking for pow in -lm" >&5 echo "configure:2413: checking for pow in -lm" >&5
ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'` ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2359,7 +2417,7 @@ else ...@@ -2359,7 +2417,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS" LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2363 "configure" #line 2421 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2370,7 +2428,7 @@ int main() { ...@@ -2370,7 +2428,7 @@ int main() {
pow() pow()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2396,7 +2454,7 @@ CFLAGS="${CFLAGS} -I/usr/local/include" ...@@ -2396,7 +2454,7 @@ CFLAGS="${CFLAGS} -I/usr/local/include"
PTHREAD_LIBS=error PTHREAD_LIBS=error
echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
echo "configure:2400: checking for pthread_attr_init in -lpthread" >&5 echo "configure:2458: checking for pthread_attr_init in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2404,7 +2462,7 @@ else ...@@ -2404,7 +2462,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2408 "configure" #line 2466 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2415,7 +2473,7 @@ int main() { ...@@ -2415,7 +2473,7 @@ int main() {
pthread_attr_init() pthread_attr_init()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2430,14 +2488,14 @@ LIBS="$ac_save_LIBS" ...@@ -2430,14 +2488,14 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
PTHREAD_LIBS="-lpthread" THREAD_LIB="-lpthread"
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
if test "x${PTHREAD_LIBS}" = xerror; then if test "x${THREAD_LIB}" = xerror; then
echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
echo "configure:2441: checking for pthread_attr_init in -lpthreads" >&5 echo "configure:2499: checking for pthread_attr_init in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2445,7 +2503,7 @@ else ...@@ -2445,7 +2503,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS" LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2449 "configure" #line 2507 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2456,7 +2514,7 @@ int main() { ...@@ -2456,7 +2514,7 @@ int main() {
pthread_attr_init() pthread_attr_init()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2471,15 +2529,15 @@ LIBS="$ac_save_LIBS" ...@@ -2471,15 +2529,15 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
PTHREAD_LIBS="-lpthreads" THREAD_LIB="-lpthreads"
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
fi fi
if test "x${PTHREAD_LIBS}" = xerror; then if test "x${THREAD_LIB}" = xerror; then
echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
echo "configure:2483: checking for pthread_attr_init in -lc_r" >&5 echo "configure:2541: checking for pthread_attr_init in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2487,7 +2545,7 @@ else ...@@ -2487,7 +2545,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS" LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2491 "configure" #line 2549 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2498,7 +2556,7 @@ int main() { ...@@ -2498,7 +2556,7 @@ int main() {
pthread_attr_init() pthread_attr_init()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2513,21 +2571,21 @@ LIBS="$ac_save_LIBS" ...@@ -2513,21 +2571,21 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
PTHREAD_LIBS="-lc_r" THREAD_LIB="-lc_r"
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
fi fi
if test "x${PTHREAD_LIBS}" = xerror; then if test "x${THREAD_LIB}" = xerror; then
PTHREAD_LIBS="" THREAD_LIBS=""
echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
echo "configure:2526: checking for pthread_attr_init" >&5 echo "configure:2584: checking for pthread_attr_init" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2531 "configure" #line 2589 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_attr_init(); below. */ which can conflict with char pthread_attr_init(); below. */
...@@ -2550,7 +2608,7 @@ pthread_attr_init(); ...@@ -2550,7 +2608,7 @@ pthread_attr_init();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_pthread_attr_init=yes" eval "ac_cv_func_pthread_attr_init=yes"
else else
...@@ -2570,10 +2628,9 @@ else ...@@ -2570,10 +2628,9 @@ else
fi fi
fi fi
LIB="${LIB} ${PTHREAD_LIBS}"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2577 "configure" #line 2634 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <pthread.h> #include <pthread.h>
EOF EOF
...@@ -2585,12 +2642,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ...@@ -2585,12 +2642,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
#define PTHREAD_COND_T_IN_PTHREAD_H 1 #define PTHREAD_COND_T_IN_PTHREAD_H 1
EOF EOF
fi fi
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2594 "configure" #line 2650 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <strings.h> #include <strings.h>
EOF EOF
...@@ -2602,7 +2658,6 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ...@@ -2602,7 +2658,6 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
#define STRNCASECMP_IN_STRINGS_H 1 #define STRNCASECMP_IN_STRINGS_H 1
EOF EOF
fi fi
rm -f conftest* rm -f conftest*
...@@ -2611,17 +2666,17 @@ for ac_hdr in stddef.h getopt.h strings.h ...@@ -2611,17 +2666,17 @@ for ac_hdr in stddef.h getopt.h strings.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2615: checking for $ac_hdr" >&5 echo "configure:2670: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2620 "configure" #line 2675 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2651,17 +2706,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h unistd.h ...@@ -2651,17 +2706,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h unistd.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2655: checking for $ac_hdr" >&5 echo "configure:2710: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2660 "configure" #line 2715 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2691,17 +2746,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h ...@@ -2691,17 +2746,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2695: checking for $ac_hdr" >&5 echo "configure:2750: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2700 "configure" #line 2755 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2731,17 +2786,17 @@ for ac_hdr in dlfcn.h image.h ...@@ -2731,17 +2786,17 @@ for ac_hdr in dlfcn.h image.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2735: checking for $ac_hdr" >&5 echo "configure:2790: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2740 "configure" #line 2795 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2771,17 +2826,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h ...@@ -2771,17 +2826,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2775: checking for $ac_hdr" >&5 echo "configure:2830: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2780 "configure" #line 2835 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2811,17 +2866,17 @@ for ac_hdr in machine/param.h ...@@ -2811,17 +2866,17 @@ for ac_hdr in machine/param.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2815: checking for $ac_hdr" >&5 echo "configure:2870: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2820 "configure" #line 2875 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2852,17 +2907,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h ...@@ -2852,17 +2907,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2856: checking for $ac_hdr" >&5 echo "configure:2911: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2861 "configure" #line 2916 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2891,9 +2946,9 @@ done ...@@ -2891,9 +2946,9 @@ done
CFLAGS="${save_CFLAGS} -Wall -Werror" CFLAGS="${save_CFLAGS} -Wall -Werror"
echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
echo "configure:2895: checking for ntohl in sys/param.h" >&5 echo "configure:2950: checking for ntohl in sys/param.h" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2897 "configure" #line 2952 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/param.h> #include <sys/param.h>
void foo() { int meuh; ntohl(meuh); } void foo() { int meuh; ntohl(meuh); }
...@@ -2901,7 +2956,7 @@ int main() { ...@@ -2901,7 +2956,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define NTOHL_IN_SYS_PARAM_H 1 #define NTOHL_IN_SYS_PARAM_H 1
...@@ -2918,16 +2973,16 @@ rm -f conftest* ...@@ -2918,16 +2973,16 @@ rm -f conftest*
CFLAGS="${save_CFLAGS} -bundle -undefined suppress" CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
echo $ac_n "checking if \$CC compiles plugins with -bundle -undefined suppress""... $ac_c" 1>&6 echo $ac_n "checking if \$CC compiles plugins with -bundle -undefined suppress""... $ac_c" 1>&6
echo "configure:2922: checking if \$CC compiles plugins with -bundle -undefined suppress" >&5 echo "configure:2977: checking if \$CC compiles plugins with -bundle -undefined suppress" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2924 "configure" #line 2979 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; echo "$ac_t""yes" 1>&6 PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; echo "$ac_t""yes" 1>&6
else else
...@@ -2940,16 +2995,16 @@ rm -f conftest* ...@@ -2940,16 +2995,16 @@ rm -f conftest*
CFLAGS="${save_CFLAGS} -shared" CFLAGS="${save_CFLAGS} -shared"
echo $ac_n "checking if \$CC compiles plugins with -shared""... $ac_c" 1>&6 echo $ac_n "checking if \$CC compiles plugins with -shared""... $ac_c" 1>&6
echo "configure:2944: checking if \$CC compiles plugins with -shared" >&5 echo "configure:2999: checking if \$CC compiles plugins with -shared" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2946 "configure" #line 3001 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
PLCFLAGS="${PLCFLAGS} -shared"; echo "$ac_t""yes" 1>&6 PLCFLAGS="${PLCFLAGS} -shared"; echo "$ac_t""yes" 1>&6
else else
...@@ -2963,9 +3018,9 @@ rm -f conftest* ...@@ -2963,9 +3018,9 @@ rm -f conftest*
CFLAGS="${save_CFLAGS}" CFLAGS="${save_CFLAGS}"
echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6 echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
echo "configure:2967: checking for boolean_t in sys/types.h" >&5 echo "configure:3022: checking for boolean_t in sys/types.h" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2969 "configure" #line 3024 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
void quux() { boolean_t foo; } void quux() { boolean_t foo; }
...@@ -2973,7 +3028,7 @@ int main() { ...@@ -2973,7 +3028,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_SYS_TYPES_H 1 #define BOOLEAN_T_IN_SYS_TYPES_H 1
...@@ -2988,9 +3043,9 @@ else ...@@ -2988,9 +3043,9 @@ else
fi fi
rm -f conftest* rm -f conftest*
echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6 echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
echo "configure:2992: checking for boolean_t in pthread.h" >&5 echo "configure:3047: checking for boolean_t in pthread.h" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2994 "configure" #line 3049 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <pthread.h> #include <pthread.h>
void quux() { boolean_t foo; } void quux() { boolean_t foo; }
...@@ -2998,7 +3053,7 @@ int main() { ...@@ -2998,7 +3053,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_PTHREAD_H 1 #define BOOLEAN_T_IN_PTHREAD_H 1
...@@ -3014,12 +3069,12 @@ fi ...@@ -3014,12 +3069,12 @@ fi
rm -f conftest* rm -f conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:3018: checking for working const" >&5 echo "configure:3073: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3023 "configure" #line 3078 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
...@@ -3068,7 +3123,7 @@ ccp = (char const *const *) p; ...@@ -3068,7 +3123,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
...@@ -3089,12 +3144,12 @@ EOF ...@@ -3089,12 +3144,12 @@ EOF
fi fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:3093: checking for ANSI C header files" >&5 echo "configure:3148: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3098 "configure" #line 3153 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -3102,7 +3157,7 @@ else ...@@ -3102,7 +3157,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3119,7 +3174,7 @@ rm -f conftest* ...@@ -3119,7 +3174,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3123 "configure" #line 3178 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
...@@ -3137,7 +3192,7 @@ fi ...@@ -3137,7 +3192,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3141 "configure" #line 3196 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
...@@ -3158,7 +3213,7 @@ if test "$cross_compiling" = yes; then ...@@ -3158,7 +3213,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3162 "configure" #line 3217 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
...@@ -3169,7 +3224,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); ...@@ -3169,7 +3224,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF EOF
if { (eval echo configure:3173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
: :
else else
...@@ -3193,12 +3248,12 @@ EOF ...@@ -3193,12 +3248,12 @@ EOF
fi fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:3197: checking for size_t" >&5 echo "configure:3252: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3202 "configure" #line 3257 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#if STDC_HEADERS #if STDC_HEADERS
...@@ -3226,12 +3281,12 @@ EOF ...@@ -3226,12 +3281,12 @@ EOF
fi fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:3230: checking whether time.h and sys/time.h may both be included" >&5 echo "configure:3285: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3235 "configure" #line 3290 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
...@@ -3240,7 +3295,7 @@ int main() { ...@@ -3240,7 +3295,7 @@ int main() {
struct tm *tp; struct tm *tp;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_header_time=yes ac_cv_header_time=yes
else else
...@@ -3278,16 +3333,16 @@ case x$host_os in ...@@ -3278,16 +3333,16 @@ case x$host_os in
esac esac
echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
echo "configure:3282: checking if \$CC groks MMX inline assembly" >&5 echo "configure:3337: checking if \$CC groks MMX inline assembly" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3284 "configure" #line 3339 "configure"
#include "confdefs.h" #include "confdefs.h"
void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));} void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
...@@ -3300,16 +3355,16 @@ fi ...@@ -3300,16 +3355,16 @@ fi
rm -f conftest* rm -f conftest*
echo $ac_n "checking if \$CC groks MMX EXT or SSE inline assembly""... $ac_c" 1>&6 echo $ac_n "checking if \$CC groks MMX EXT or SSE inline assembly""... $ac_c" 1>&6
echo "configure:3304: checking if \$CC groks MMX EXT or SSE inline assembly" >&5 echo "configure:3359: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3306 "configure" #line 3361 "configure"
#include "confdefs.h" #include "confdefs.h"
void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));} void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
...@@ -3325,17 +3380,17 @@ for ac_hdr in sys/ioctl.h ...@@ -3325,17 +3380,17 @@ for ac_hdr in sys/ioctl.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3329: checking for $ac_hdr" >&5 echo "configure:3384: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3334 "configure" #line 3389 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3356,24 +3411,22 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ...@@ -3356,24 +3411,22 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
#define $ac_tr_hdr 1 #define $ac_tr_hdr 1
EOF EOF
BUILTINS="${BUILTINS} dvd" LIBDVDCSS=1
LIB_DVD="${LIB_DVD} -Llib -L../../lib -ldvdcss"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
for ac_hdr in sys/cdio.h sys/dvdio.h linux/cdrom.h for ac_hdr in sys/cdio.h sys/dvdio.h linux/cdrom.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3367: checking for $ac_hdr" >&5 echo "configure:3420: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3372 "configure" #line 3425 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3401,7 +3454,7 @@ done ...@@ -3401,7 +3454,7 @@ done
BSD_DVD_STRUCT=0 BSD_DVD_STRUCT=0
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3405 "configure" #line 3458 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/dvdio.h> #include <sys/dvdio.h>
EOF EOF
...@@ -3419,7 +3472,7 @@ fi ...@@ -3419,7 +3472,7 @@ fi
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3423 "configure" #line 3476 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/cdio.h> #include <sys/cdio.h>
EOF EOF
...@@ -3443,7 +3496,7 @@ EOF ...@@ -3443,7 +3496,7 @@ EOF
fi fi
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3447 "configure" #line 3500 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <linux/cdrom.h> #include <linux/cdrom.h>
EOF EOF
...@@ -3466,32 +3519,80 @@ fi ...@@ -3466,32 +3519,80 @@ fi
done done
# Check whether --enable-dummy or --disable-dummy was given. # Check whether --enable-pth or --disable-pth was given.
if test "${enable_dummy+set}" = set; then if test "${enable_pth+set}" = set; then
enableval="$enable_dummy" enableval="$enable_pth"
: if test x$enableval = xyes; then
echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
echo "configure:3528: checking for pth_init in -lpth" >&5
ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lpth $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3536 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pth_init();
int main() {
pth_init()
; return 0; }
EOF
if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi fi
rm -f conftest*
LIBS="$ac_save_LIBS"
if test x$enable_dummy != xno; then fi
BUILTINS="${BUILTINS} dummy"; fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo pth | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
# Check whether --enable-null or --disable-null was given. LIBS="-lpth $LIBS"
if test "${enable_null+set}" = set; then
enableval="$enable_null" else
: echo "$ac_t""no" 1>&6
fi fi
if test x$enable_null != xno; then cat > conftest.$ac_ext <<EOF
BUILTINS="${BUILTINS} null"; fi #line 3575 "configure"
#include "confdefs.h"
#include <pth.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "pth_init" >/dev/null 2>&1; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTH_INIT_IN_PTH_H 1
EOF
# Check whether --enable-rc or --disable-rc was given. THREAD_LIB="-lpth"
if test "${enable_rc+set}" = set; then fi
enableval="$enable_rc"
:
fi fi
rm -f conftest*
if test x$enable_rc != xno; then
BUILTINS="${BUILTINS} rc"; fi fi
LIB="${LIB} ${THREAD_LIB}"
# Check whether --enable-ppro or --disable-ppro was given. # Check whether --enable-ppro or --disable-ppro was given.
if test "${enable_ppro+set}" = set; then if test "${enable_ppro+set}" = set; then
...@@ -3567,6 +3668,83 @@ else ...@@ -3567,6 +3668,83 @@ else
fi fi
for ac_hdr in videolan/dvdcss.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3676: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3681 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
# installed libdvdcss
BUILTINS="${BUILTINS} dvd"
LIB_DVD="${LIB_DVD} -ldvdcss"
else
echo "$ac_t""no" 1>&6
if test x${LIBDVDCSS} = x1; then
# local libdvdcss
LOCAL_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
fi
fi
done
# Check whether --enable-dummy or --disable-dummy was given.
if test "${enable_dummy+set}" = set; then
enableval="$enable_dummy"
:
fi
if test x$enable_dummy != xno; then
BUILTINS="${BUILTINS} dummy"; fi
# Check whether --enable-null or --disable-null was given.
if test "${enable_null+set}" = set; then
enableval="$enable_null"
:
fi
if test x$enable_null != xno; then
BUILTINS="${BUILTINS} null"; fi
# Check whether --enable-rc or --disable-rc was given.
if test "${enable_rc+set}" = set; then
enableval="$enable_rc"
:
fi
if test x$enable_rc != xno; then
BUILTINS="${BUILTINS} rc"; fi
SYS=${host_os} SYS=${host_os}
if test x$host_os = xbeos; then if test x$host_os = xbeos; then
...@@ -3595,7 +3773,7 @@ if test "${enable_esd+set}" = set; then ...@@ -3595,7 +3773,7 @@ if test "${enable_esd+set}" = set; then
# Extract the first word of "esd-config", so it can be a program name with args. # Extract the first word of "esd-config", so it can be a program name with args.
set dummy esd-config; ac_word=$2 set dummy esd-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3599: checking for $ac_word" >&5 echo "configure:3777: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -3660,17 +3838,17 @@ else ...@@ -3660,17 +3838,17 @@ else
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3664: checking for $ac_hdr" >&5 echo "configure:3842: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3669 "configure" #line 3847 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3741,17 +3919,17 @@ if test "${with_sdl+set}" = set; then ...@@ -3741,17 +3919,17 @@ if test "${with_sdl+set}" = set; then
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3745: checking for $ac_hdr" >&5 echo "configure:3923: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3750 "configure" #line 3928 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3789,17 +3967,17 @@ fi ...@@ -3789,17 +3967,17 @@ fi
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3793: checking for $ac_hdr" >&5 echo "configure:3971: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3798 "configure" #line 3976 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3836,24 +4014,24 @@ if test "${with_directx+set}" = set; then ...@@ -3836,24 +4014,24 @@ if test "${with_directx+set}" = set; then
PLUGINS="${PLUGINS} directx"; PLUGINS="${PLUGINS} directx";
if test "x$withval" != "xyes"; if test "x$withval" != "xyes";
then then
LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lddraw -ldsound" LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
INCLUDE="${INCLUDE} -I"$withval"/include" INCLUDE="${INCLUDE} -I"$withval"/include"
else else
for ac_hdr in directx.h for ac_hdr in directx.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3847: checking for $ac_hdr" >&5 echo "configure:4025: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3852 "configure" #line 4030 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3880,7 +4058,7 @@ echo "Cannot find DirectX headers !"; exit ...@@ -3880,7 +4058,7 @@ echo "Cannot find DirectX headers !"; exit
fi fi
done done
LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound" LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
fi fi
fi fi
fi fi
...@@ -3891,17 +4069,17 @@ fi ...@@ -3891,17 +4069,17 @@ fi
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3895: checking for $ac_hdr" >&5 echo "configure:4073: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3900 "configure" #line 4078 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3922,7 +4100,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ...@@ -3922,7 +4100,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
#define $ac_tr_hdr 1 #define $ac_tr_hdr 1
EOF EOF
PLUGINS="${PLUGINS} directx" PLUGINS="${PLUGINS} directx"
LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound" LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
...@@ -4001,7 +4179,7 @@ if test x$enable_gtk != xno; then ...@@ -4001,7 +4179,7 @@ if test x$enable_gtk != xno; then
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4005: checking for $ac_word" >&5 echo "configure:4183: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -4061,17 +4239,17 @@ if test x$enable_x11 != xno; then ...@@ -4061,17 +4239,17 @@ if test x$enable_x11 != xno; then
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4065: checking for $ac_hdr" >&5 echo "configure:4243: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4070 "configure" #line 4248 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -4123,17 +4301,17 @@ if test x$enable_xvideo != xno; then ...@@ -4123,17 +4301,17 @@ if test x$enable_xvideo != xno; then
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4127: checking for $ac_hdr" >&5 echo "configure:4305: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4132 "configure" #line 4310 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -4171,17 +4349,17 @@ if test "${enable_alsa+set}" = set; then ...@@ -4171,17 +4349,17 @@ if test "${enable_alsa+set}" = set; then
enableval="$enable_alsa" enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
echo "configure:4175: checking for sys/asoundlib.h" >&5 echo "configure:4353: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4180 "configure" #line 4358 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -4198,7 +4376,7 @@ fi ...@@ -4198,7 +4376,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
echo "configure:4202: checking for main in -lasound" >&5 echo "configure:4380: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -4206,14 +4384,14 @@ else ...@@ -4206,14 +4384,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS" LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4210 "configure" #line 4388 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -4287,6 +4465,9 @@ fi ...@@ -4287,6 +4465,9 @@ fi
...@@ -4450,6 +4631,7 @@ s%@DEFINE@%$DEFINE%g ...@@ -4450,6 +4631,7 @@ s%@DEFINE@%$DEFINE%g
s%@INCLUDE@%$INCLUDE%g s%@INCLUDE@%$INCLUDE%g
s%@DEBUG@%$DEBUG%g s%@DEBUG@%$DEBUG%g
s%@STATS@%$STATS%g s%@STATS@%$STATS%g
s%@ASM@%$ASM%g
s%@TRACE@%$TRACE%g s%@TRACE@%$TRACE%g
s%@OPTIMS@%$OPTIMS%g s%@OPTIMS@%$OPTIMS%g
s%@CSS@%$CSS%g s%@CSS@%$CSS%g
...@@ -4481,6 +4663,7 @@ s%@CFLAGS_DVD@%$CFLAGS_DVD%g ...@@ -4481,6 +4663,7 @@ s%@CFLAGS_DVD@%$CFLAGS_DVD%g
s%@CFLAGS_GTK@%$CFLAGS_GTK%g s%@CFLAGS_GTK@%$CFLAGS_GTK%g
s%@CFLAGS_SDL@%$CFLAGS_SDL%g s%@CFLAGS_SDL@%$CFLAGS_SDL%g
s%@CFLAGS_X11@%$CFLAGS_X11%g s%@CFLAGS_X11@%$CFLAGS_X11%g
s%@LOCAL_LIBDVDCSS@%$LOCAL_LIBDVDCSS%g
CEOF CEOF
EOF EOF
...@@ -4707,6 +4890,7 @@ global configuration ...@@ -4707,6 +4890,7 @@ global configuration
system : ${SYS} system : ${SYS}
architecture : ${ARCH} architecture : ${ARCH}
optimizations : ${OPTIMS} optimizations : ${OPTIMS}
inline assembly : ${ASM}
vlc configuration vlc configuration
----------------- -----------------
......
...@@ -50,6 +50,8 @@ AC_CHECK_FUNC(inet_aton,,[ ...@@ -50,6 +50,8 @@ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_FUNCS(vasprintf) AC_CHECK_FUNCS(vasprintf)
AC_CHECK_FUNCS(swab) AC_CHECK_FUNCS(swab)
AC_CHECK_FUNCS(sigrelse)
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)], AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this: [ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long], AC_CHECK_LIB([gnugetopt],[getopt_long],
...@@ -67,28 +69,25 @@ CFLAGS="${CFLAGS} -I/usr/local/include" ...@@ -67,28 +69,25 @@ CFLAGS="${CFLAGS} -I/usr/local/include"
dnl Check for pthreads - borrowed from XMMS dnl Check for pthreads - borrowed from XMMS
PTHREAD_LIBS=error PTHREAD_LIBS=error
AC_CHECK_LIB(pthread,pthread_attr_init,PTHREAD_LIBS="-lpthread") AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
if test "x${PTHREAD_LIBS}" = xerror; then if test "x${THREAD_LIB}" = xerror; then
AC_CHECK_LIB(pthreads,pthread_attr_init,PTHREAD_LIBS="-lpthreads") AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
fi fi
if test "x${PTHREAD_LIBS}" = xerror; then if test "x${THREAD_LIB}" = xerror; then
AC_CHECK_LIB(c_r,pthread_attr_init,PTHREAD_LIBS="-lc_r") AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
fi fi
if test "x${PTHREAD_LIBS}" = xerror; then if test "x${THREAD_LIB}" = xerror; then
PTHREAD_LIBS="" THREAD_LIBS=""
AC_CHECK_FUNC(pthread_attr_init) AC_CHECK_FUNC(pthread_attr_init)
fi fi
LIB="${LIB} ${PTHREAD_LIBS}"
dnl Check for misc headers dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[ AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1, AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_cond_t.) Define if <pthread.h> defines pthread_cond_t.)])
])
AC_EGREP_HEADER(strncasecmp,strings.h,[ AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1, AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Define if <strings.h> defines strncasecmp.) Define if <strings.h> defines strncasecmp.)])
])
dnl Check for headers dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h) AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
...@@ -176,12 +175,10 @@ AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],, ...@@ -176,12 +175,10 @@ AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl dnl
dnl DVD module: check for DVD ioctls dnl libdvdcss: check for DVD ioctls
dnl dnl
AC_CHECK_HEADERS(sys/ioctl.h,[ AC_CHECK_HEADERS(sys/ioctl.h,[
BUILTINS="${BUILTINS} dvd" LIBDVDCSS=1
LIB_DVD="${LIB_DVD} -Llib -L../../lib -ldvdcss"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h) AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h)
BSD_DVD_STRUCT=0 BSD_DVD_STRUCT=0
dnl dnl
...@@ -214,34 +211,26 @@ AC_CHECK_HEADERS(sys/ioctl.h,[ ...@@ -214,34 +211,26 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
]) ])
dnl dnl
dnl dummy plugin dnl GNU portable threads
dnl
AC_ARG_ENABLE(dummy,
[ --disable-dummy dummy module (default enabled)])
if test x$enable_dummy != xno; then
BUILTINS="${BUILTINS} dummy"; fi
dnl
dnl null plugin
dnl dnl
AC_ARG_ENABLE(null, AC_ARG_ENABLE(pth,
[ --disable-null Null module (default enabled)]) [ --enable-pth Enable GNU Pth support (default disabled)],
if test x$enable_null != xno; then [ if test x$enableval = xyes; then
BUILTINS="${BUILTINS} null"; fi AC_CHECK_LIB(pth,pth_init)
AC_EGREP_HEADER(pth_init,pth.h,[
AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
Define if <pth.h> defines pth_init)
THREAD_LIB="-lpth"
fi])
])
dnl LIB="${LIB} ${THREAD_LIB}"
dnl rc plugin
dnl
AC_ARG_ENABLE(rc,
[ --disable-rc rc module (default enabled)])
if test x$enable_rc != xno; then
BUILTINS="${BUILTINS} rc"; fi
dnl dnl
dnl PentiumPro acceleration dnl PentiumPro acceleration
dnl dnl
AC_ARG_ENABLE(ppro, AC_ARG_ENABLE(ppro,
[ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)], [ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ], [ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ]) [ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ])
...@@ -303,6 +292,45 @@ AC_ARG_ENABLE(optimizations, ...@@ -303,6 +292,45 @@ AC_ARG_ENABLE(optimizations,
[ if test x$enableval = xno; then OPTIMS=0; fi ], [ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ]) [ OPTIMS=1 ])
dnl
dnl DVD module: check for installed libdvdcss or local libdvdcss
dnl TODO: use user-provided --with-dvdcss flag
dnl
AC_CHECK_HEADERS(videolan/dvdcss.h,[
# installed libdvdcss
BUILTINS="${BUILTINS} dvd"
LIB_DVD="${LIB_DVD} -ldvdcss"],
[if test x${LIBDVDCSS} = x1; then
# local libdvdcss
LOCAL_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
fi])
dnl
dnl dummy plugin
dnl
AC_ARG_ENABLE(dummy,
[ --disable-dummy dummy module (default enabled)])
if test x$enable_dummy != xno; then
BUILTINS="${BUILTINS} dummy"; fi
dnl
dnl null plugin
dnl
AC_ARG_ENABLE(null,
[ --disable-null Null module (default enabled)])
if test x$enable_null != xno; then
BUILTINS="${BUILTINS} null"; fi
dnl
dnl rc plugin
dnl
AC_ARG_ENABLE(rc,
[ --disable-rc rc module (default enabled)])
if test x$enable_rc != xno; then
BUILTINS="${BUILTINS} rc"; fi
SYS=${host_os} SYS=${host_os}
dnl special case for BeOS dnl special case for BeOS
...@@ -423,18 +451,18 @@ AC_ARG_WITH(directx, ...@@ -423,18 +451,18 @@ AC_ARG_WITH(directx,
PLUGINS="${PLUGINS} directx"; PLUGINS="${PLUGINS} directx";
if test "x$withval" != "xyes"; if test "x$withval" != "xyes";
then then
LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lddraw -ldsound" LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
INCLUDE="${INCLUDE} -I"$withval"/include" INCLUDE="${INCLUDE} -I"$withval"/include"
else else
AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit]) AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit])
LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound" LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
fi fi
fi ]) fi ])
if test "x$withval" = "x"; if test "x$withval" = "x";
then then
AC_CHECK_HEADERS(directx.h, AC_CHECK_HEADERS(directx.h,
[PLUGINS="${PLUGINS} directx" [PLUGINS="${PLUGINS} directx"
LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"]) LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"])
fi fi
dnl dnl
...@@ -582,6 +610,7 @@ AC_SUBST(DEFINE) ...@@ -582,6 +610,7 @@ AC_SUBST(DEFINE)
AC_SUBST(INCLUDE) AC_SUBST(INCLUDE)
AC_SUBST(DEBUG) AC_SUBST(DEBUG)
AC_SUBST(STATS) AC_SUBST(STATS)
AC_SUBST(ASM)
AC_SUBST(TRACE) AC_SUBST(TRACE)
AC_SUBST(OPTIMS) AC_SUBST(OPTIMS)
AC_SUBST(CSS) AC_SUBST(CSS)
...@@ -617,6 +646,8 @@ AC_SUBST(CFLAGS_GTK) ...@@ -617,6 +646,8 @@ AC_SUBST(CFLAGS_GTK)
AC_SUBST(CFLAGS_SDL) AC_SUBST(CFLAGS_SDL)
AC_SUBST(CFLAGS_X11) AC_SUBST(CFLAGS_X11)
AC_SUBST(LOCAL_LIBDVDCSS)
AC_OUTPUT([Makefile.opts include/config.h]) AC_OUTPUT([Makefile.opts include/config.h])
echo " echo "
...@@ -625,6 +656,7 @@ global configuration ...@@ -625,6 +656,7 @@ global configuration
system : ${SYS} system : ${SYS}
architecture : ${ARCH} architecture : ${ARCH}
optimizations : ${OPTIMS} optimizations : ${OPTIMS}
inline assembly : ${ASM}
vlc configuration vlc configuration
----------------- -----------------
......
...@@ -2,7 +2,7 @@ Source: vlc ...@@ -2,7 +2,7 @@ Source: vlc
Section: graphics Section: graphics
Priority: optional Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org> Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0), xlib6g-dev, libgnome-dev, libggi2-dev, libglide-dev [i386], libesd0-dev, libsdl1.2-dev, libqt-dev, libasound2-dev Build-Depends: debhelper (>=2.2.0), xlib6g-dev, libgnome-dev, libggi2-dev, libglide3-dev [i386], libesd0-dev, libsdl1.2-dev, libqt-dev, libasound2-dev
Standards-Version: 3.0.1 Standards-Version: 3.0.1
Package: vlc Package: vlc
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
include ../../Makefile.opts include ../../Makefile.opts
LIBDVDCSS_VERSION = 0.0.1
LIBDVDCSS_MAJOR = 0
# #
# Objects # Objects
# #
...@@ -18,13 +21,23 @@ $(LIBDVDCSS_O): %.o: .dep/%.d ...@@ -18,13 +21,23 @@ $(LIBDVDCSS_O): %.o: .dep/%.d
$(LIBDVDCSS_O): %.o: %.c $(LIBDVDCSS_O): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $< $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
../../lib/libdvdcss.so: $(LIBDVDCSS_O) ../../lib/libdvdcss.so.$(LIBDVDCSS_VERSION): $(LIBDVDCSS_O)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
rm -f ../../lib/libdvdcss.so && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) ../../lib/libdvdcss.so
rm -f ../../lib/libdvdcss.so.$(LIBDVDCSS_MAJOR) && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) ../../lib/libdvdcss.so.$(LIBDVDCSS_MAJOR)
../../lib/libdvdcss.a: $(LIBDVDCSS_O) ../../lib/libdvdcss.a: $(LIBDVDCSS_O)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@ $(RANLIB) $@
#all: ../../lib/libdvdcss.so ../../lib/libdvdcss.a all: ../../lib/libdvdcss.so.$(LIBDVDCSS_VERSION) ../../lib/libdvdcss.a
all: ../../lib/libdvdcss.a
install:
mkdir -p $(DESTDIR)$(includedir)/videolan
$(INSTALL) -m 644 videolan/dvdcss.h $(DESTDIR)$(includedir)/videolan
mkdir -p $(DESTDIR)$(libdir)
$(INSTALL) -m 644 ../../lib/libdvdcss.a $(DESTDIR)$(libdir)
$(INSTALL) -m 644 ../../lib/libdvdcss.so.$(LIBDVDCSS_VERSION) $(DESTDIR)$(libdir)
rm -f $(DESTDIR)$(libdir)/libdvdcss.so && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) $(DESTDIR)$(libdir)/libdvdcss.so
rm -f $(DESTDIR)$(libdir)/libdvdcss.so.$(LIBDVDCSS_MAJOR) && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) $(DESTDIR)$(libdir)/libdvdcss.so.$(LIBDVDCSS_MAJOR)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libdvdcss.c: DVD reading library. * libdvdcss.c: DVD reading library.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.c,v 1.1 2001/06/12 22:14:44 sam Exp $ * $Id: libdvdcss.c,v 1.2 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -57,10 +57,12 @@ static int _dvdcss_read ( dvdcss_handle, void *p_buffer, int i_blocks ); ...@@ -57,10 +57,12 @@ static int _dvdcss_read ( dvdcss_handle, void *p_buffer, int i_blocks );
static int _dvdcss_readv ( dvdcss_handle, struct iovec *p_iovec, int i_blocks ); static int _dvdcss_readv ( dvdcss_handle, struct iovec *p_iovec, int i_blocks );
/***************************************************************************** /*****************************************************************************
* dvdcss_init: initialize libdvdcss * dvdcss_open: initialize library, open a DVD device, crack CSS key
*****************************************************************************/ *****************************************************************************/
extern dvdcss_handle dvdcss_init ( int i_flags ) extern dvdcss_handle dvdcss_open ( char *psz_target, int i_flags )
{ {
int i_ret;
dvdcss_handle dvdcss; dvdcss_handle dvdcss;
/* Allocate the library structure */ /* Allocate the library structure */
...@@ -76,50 +78,15 @@ extern dvdcss_handle dvdcss_init ( int i_flags ) ...@@ -76,50 +78,15 @@ extern dvdcss_handle dvdcss_init ( int i_flags )
} }
/* Initialize structure */ /* Initialize structure */
dvdcss->i_status = DVDCSS_STATUS_NONE;
dvdcss->b_debug = i_flags & DVDCSS_INIT_DEBUG; dvdcss->b_debug = i_flags & DVDCSS_INIT_DEBUG;
dvdcss->b_errors = !(i_flags & DVDCSS_INIT_QUIET); dvdcss->b_errors = !(i_flags & DVDCSS_INIT_QUIET);
dvdcss->psz_error = "no error"; dvdcss->psz_error = "no error";
/* XXX: additional initialization stuff might come here */
dvdcss->i_status |= DVDCSS_STATUS_INIT;
return dvdcss;
}
/*****************************************************************************
* dvdcss_error: return the last libdvdcss error message
*****************************************************************************/
extern char * dvdcss_error ( dvdcss_handle dvdcss )
{
return dvdcss->psz_error;
}
/*****************************************************************************
* dvdcss_open: open a DVD device, crack CSS key if disc is encrypted
*****************************************************************************/
extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
{
int i_ret;
if( ! (dvdcss->i_status & DVDCSS_STATUS_INIT) )
{
_dvdcss_error( dvdcss, "library not initialized" );
return -1;
}
if( dvdcss->i_status & DVDCSS_STATUS_OPEN )
{
_dvdcss_error( dvdcss, "a device is already opened" );
return -1;
}
i_ret = _dvdcss_open( dvdcss, psz_target ); i_ret = _dvdcss_open( dvdcss, psz_target );
if( i_ret < 0 ) if( i_ret < 0 )
{ {
return i_ret; free( dvdcss );
return NULL;
} }
i_ret = CSSTest( dvdcss ); i_ret = CSSTest( dvdcss );
...@@ -127,7 +94,8 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target ) ...@@ -127,7 +94,8 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
{ {
_dvdcss_error( dvdcss, "css test failed" ); _dvdcss_error( dvdcss, "css test failed" );
_dvdcss_close( dvdcss ); _dvdcss_close( dvdcss );
return i_ret; free( dvdcss );
return NULL;
} }
dvdcss->b_encrypted = i_ret; dvdcss->b_encrypted = i_ret;
...@@ -140,13 +108,20 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target ) ...@@ -140,13 +108,20 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
if( i_ret < 0 ) if( i_ret < 0 )
{ {
_dvdcss_close( dvdcss ); _dvdcss_close( dvdcss );
return i_ret; free( dvdcss );
return NULL;
} }
} }
dvdcss->i_status |= DVDCSS_STATUS_OPEN; return dvdcss;
}
return 0; /*****************************************************************************
* dvdcss_error: return the last libdvdcss error message
*****************************************************************************/
extern char * dvdcss_error ( dvdcss_handle dvdcss )
{
return dvdcss->psz_error;
} }
/***************************************************************************** /*****************************************************************************
...@@ -154,12 +129,6 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target ) ...@@ -154,12 +129,6 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
*****************************************************************************/ *****************************************************************************/
extern int dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks ) extern int dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
{ {
if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
{
_dvdcss_error( dvdcss, "no device opened" );
return -1;
}
return _dvdcss_seek( dvdcss, i_blocks ); return _dvdcss_seek( dvdcss, i_blocks );
} }
...@@ -170,12 +139,6 @@ extern int dvdcss_crack ( dvdcss_handle dvdcss, int i_title, int i_block ) ...@@ -170,12 +139,6 @@ extern int dvdcss_crack ( dvdcss_handle dvdcss, int i_title, int i_block )
{ {
int i_ret; int i_ret;
if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
{
_dvdcss_error( dvdcss, "no device opened" );
return -1;
}
if( ! dvdcss->b_encrypted ) if( ! dvdcss->b_encrypted )
{ {
return 0; return 0;
...@@ -210,12 +173,6 @@ extern int dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer, ...@@ -210,12 +173,6 @@ extern int dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
{ {
int i_ret; int i_ret;
if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
{
_dvdcss_error( dvdcss, "no device opened" );
return -1;
}
i_ret = _dvdcss_read( dvdcss, p_buffer, i_blocks ); i_ret = _dvdcss_read( dvdcss, p_buffer, i_blocks );
if( i_ret != i_blocks if( i_ret != i_blocks
...@@ -248,12 +205,6 @@ extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec, ...@@ -248,12 +205,6 @@ extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
void *iov_base; void *iov_base;
size_t iov_len; size_t iov_len;
if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
{
_dvdcss_error( dvdcss, "no device opened" );
return -1;
}
i_ret = _dvdcss_readv( dvdcss, P_IOVEC, i_blocks ); i_ret = _dvdcss_readv( dvdcss, P_IOVEC, i_blocks );
if( i_ret != i_blocks if( i_ret != i_blocks
...@@ -296,18 +247,12 @@ extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec, ...@@ -296,18 +247,12 @@ extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
} }
/***************************************************************************** /*****************************************************************************
* dvdcss_close: close the DVD device * dvdcss_close: close the DVD device and clean up the library
*****************************************************************************/ *****************************************************************************/
extern int dvdcss_close ( dvdcss_handle dvdcss ) extern int dvdcss_close ( dvdcss_handle dvdcss )
{ {
int i_ret; int i_ret;
if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
{
_dvdcss_error( dvdcss, "no device opened" );
return -1;
}
i_ret = _dvdcss_close( dvdcss ); i_ret = _dvdcss_close( dvdcss );
if( i_ret < 0 ) if( i_ret < 0 )
...@@ -315,22 +260,6 @@ extern int dvdcss_close ( dvdcss_handle dvdcss ) ...@@ -315,22 +260,6 @@ extern int dvdcss_close ( dvdcss_handle dvdcss )
return i_ret; return i_ret;
} }
dvdcss->i_status &= ~DVDCSS_STATUS_OPEN;
return 0;
}
/*****************************************************************************
* dvdcss_end: clean up the library
*****************************************************************************/
extern int dvdcss_end ( dvdcss_handle dvdcss )
{
if( dvdcss->i_status & DVDCSS_STATUS_OPEN )
{
_dvdcss_error( dvdcss, "a device is still open" );
return -1;
}
free( dvdcss ); free( dvdcss );
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* private.h: private DVD reading library data * private.h: private DVD reading library data
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.h,v 1.1 2001/06/12 22:14:44 sam Exp $ * $Id: libdvdcss.h,v 1.2 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -32,9 +32,6 @@ ...@@ -32,9 +32,6 @@
*****************************************************************************/ *****************************************************************************/
struct dvdcss_s struct dvdcss_s
{ {
/* Status */
int i_status;
/* File descriptor */ /* File descriptor */
int i_fd; int i_fd;
...@@ -49,13 +46,6 @@ struct dvdcss_s ...@@ -49,13 +46,6 @@ struct dvdcss_s
}; };
/*****************************************************************************
* Flags
*****************************************************************************/
#define DVDCSS_STATUS_NONE 0
#define DVDCSS_STATUS_INIT 1 << 0
#define DVDCSS_STATUS_OPEN 1 << 1
/***************************************************************************** /*****************************************************************************
* Error management * Error management
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libdvdcss.h: DVD reading library, exported functions. * libdvdcss.h: DVD reading library, exported functions.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: dvdcss.h,v 1.1 2001/06/12 22:14:44 sam Exp $ * $Id: dvdcss.h,v 1.2 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -42,10 +42,8 @@ typedef struct dvdcss_s* dvdcss_handle; ...@@ -42,10 +42,8 @@ typedef struct dvdcss_s* dvdcss_handle;
/***************************************************************************** /*****************************************************************************
* Exported prototypes * Exported prototypes
*****************************************************************************/ *****************************************************************************/
extern dvdcss_handle dvdcss_init ( int i_flags ); extern dvdcss_handle dvdcss_open ( char *psz_target,
extern int dvdcss_end ( dvdcss_handle ); int i_flags );
extern int dvdcss_open ( dvdcss_handle,
char *psz_target );
extern int dvdcss_close ( dvdcss_handle ); extern int dvdcss_close ( dvdcss_handle );
extern int dvdcss_crack ( dvdcss_handle, extern int dvdcss_crack ( dvdcss_handle,
int i_title, int i_title,
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
/* Define if you have the setenv function. */ /* Define if you have the setenv function. */
#undef HAVE_SETENV #undef HAVE_SETENV
/* Define if you have the sigrelse function. */
#undef HAVE_SIGRELSE
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#undef HAVE_STRERROR #undef HAVE_STRERROR
...@@ -73,6 +76,9 @@ ...@@ -73,6 +76,9 @@
/* Define if you have the <cthreads.h> header file. */ /* Define if you have the <cthreads.h> header file. */
#undef HAVE_CTHREADS_H #undef HAVE_CTHREADS_H
/* Define if you have the <directx.h> header file. */
#undef HAVE_DIRECTX_H
/* Define if you have the <dlfcn.h> header file. */ /* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H #undef HAVE_DLFCN_H
...@@ -139,6 +145,12 @@ ...@@ -139,6 +145,12 @@
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define if you have the <videolan/dvdcss.h> header file. */
#undef HAVE_VIDEOLAN_DVDCSS_H
/* Define if you have the pth library (-lpth). */
#undef HAVE_LIBPTH
/* long getopt support */ /* long getopt support */
#undef HAVE_GETOPT_LONG #undef HAVE_GETOPT_LONG
...@@ -172,6 +184,9 @@ ...@@ -172,6 +184,9 @@
/* Define if <linux/cdrom.h> defines DVD_STRUCT. */ /* Define if <linux/cdrom.h> defines DVD_STRUCT. */
#undef DVD_STRUCT_IN_LINUX_CDROM_H #undef DVD_STRUCT_IN_LINUX_CDROM_H
/* Define if <pth.h> defines pth_init */
#undef PTH_INIT_IN_PTH_H
/* Define if you want DVD CSS decryption. */ /* Define if you want DVD CSS decryption. */
#undef HAVE_CSS #undef HAVE_CSS
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* This header provides a portable threads implementation. * This header provides a portable threads implementation.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: threads.h,v 1.17 2001/04/28 03:36:25 sam Exp $ * $Id: threads.h,v 1.18 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -25,25 +25,29 @@ ...@@ -25,25 +25,29 @@
#include <stdio.h> #include <stdio.h>
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) /* pthreads (like Linux & BSD) */ #if defined( PTH_INIT_IN_PTH_H ) /* GNU Pth */
#include <pthread.h> # include <pth.h>
#elif defined(HAVE_CTHREADS_H) /* GNUMach */ #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */
#include <cthreads.h> # include <pthread.h>
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) /* BeOS */ #elif defined( HAVE_CTHREADS_H ) /* GNUMach */
#undef MAX # include <cthreads.h>
#undef MIN
#include <kernel/OS.h>
#include <kernel/scheduler.h>
#include <byteorder.h>
#elif defined(WIN32) /* Win32 with MinGW32 compiler */ #elif defined( HAVE_KERNEL_SCHEDULER_H ) /* BeOS */
#include <windows.h> # undef MAX
#include <process.h> # undef MIN
# include <kernel/OS.h>
# include <kernel/scheduler.h>
# include <byteorder.h>
#elif defined( WIN32 ) /* Win32 with MinGW32 compiler */
# include <windows.h>
# include <process.h>
#else #else
#error no threads available on your system ! # error no threads available on your system !
#endif #endif
/***************************************************************************** /*****************************************************************************
...@@ -76,12 +80,17 @@ ...@@ -76,12 +80,17 @@
* Types definition * Types definition
*****************************************************************************/ *****************************************************************************/
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
typedef pth_t vlc_thread_t;
typedef pth_mutex_t vlc_mutex_t;
typedef pth_cond_t vlc_cond_t;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
typedef pthread_t vlc_thread_t; typedef pthread_t vlc_thread_t;
typedef pthread_mutex_t vlc_mutex_t; typedef pthread_mutex_t vlc_mutex_t;
typedef pthread_cond_t vlc_cond_t; typedef pthread_cond_t vlc_cond_t;
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
typedef cthread_t vlc_thread_t; typedef cthread_t vlc_thread_t;
/* Those structs are the ones defined in /include/cthreads.h but we need /* Those structs are the ones defined in /include/cthreads.h but we need
...@@ -101,7 +110,7 @@ typedef struct s_condition { ...@@ -101,7 +110,7 @@ typedef struct s_condition {
struct cond_imp *implications; struct cond_imp *implications;
} vlc_cond_t; } vlc_cond_t;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
/* This is the BeOS implementation of the vlc threads, note that the mutex is /* This is the BeOS implementation of the vlc threads, note that the mutex is
* not a real mutex and the cond_var is not like a pthread cond_var but it is * not a real mutex and the cond_var is not like a pthread cond_var but it is
* enough for what wee need */ * enough for what wee need */
...@@ -120,7 +129,7 @@ typedef struct ...@@ -120,7 +129,7 @@ typedef struct
thread_id thread; thread_id thread;
} vlc_cond_t; } vlc_cond_t;
#elif defined(WIN32) #elif defined( WIN32 )
typedef HANDLE vlc_thread_t; typedef HANDLE vlc_thread_t;
typedef HANDLE vlc_mutex_t; typedef HANDLE vlc_mutex_t;
typedef HANDLE vlc_cond_t; typedef HANDLE vlc_cond_t;
...@@ -159,21 +168,25 @@ static __inline__ int vlc_cond_timedwait( vlc_cond_t *, vlc_mutex_t *, ...@@ -159,21 +168,25 @@ static __inline__ int vlc_cond_timedwait( vlc_cond_t *, vlc_mutex_t *,
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
char *psz_name, vlc_thread_func_t func, char *psz_name, vlc_thread_func_t func,
void *p_data) void *p_data )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
*p_thread = pth_spawn( PTH_ATTR_DEFAULT, func, p_data );
return ( p_thread == NULL );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_create( p_thread, NULL, func, p_data ); return pthread_create( p_thread, NULL, func, p_data );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
*p_thread = cthread_fork( (cthread_fn_t)func, (any_t)p_data ); *p_thread = cthread_fork( (cthread_fn_t)func, (any_t)p_data );
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
*p_thread = spawn_thread( (thread_func)func, psz_name, *p_thread = spawn_thread( (thread_func)func, psz_name,
B_NORMAL_PRIORITY, p_data ); B_NORMAL_PRIORITY, p_data );
return resume_thread( *p_thread ); return resume_thread( *p_thread );
#elif defined(WIN32) #elif defined( WIN32 )
#if 0 #if 0
DWORD threadID; DWORD threadID;
/* This method is not recommended when using the MSVCRT C library, /* This method is not recommended when using the MSVCRT C library,
...@@ -198,17 +211,20 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread, ...@@ -198,17 +211,20 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
*****************************************************************************/ *****************************************************************************/
static __inline__ void vlc_thread_exit( void ) static __inline__ void vlc_thread_exit( void )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
pth_exit( 0 );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_exit( 0 ); pthread_exit( 0 );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
int result; int result;
cthread_exit( &result ); cthread_exit( &result );
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
exit_thread( 0 ); exit_thread( 0 );
#elif defined(WIN32) #elif defined( WIN32 )
#if 0 #if 0
ExitThread( 0 ); ExitThread( 0 );
#endif #endif
...@@ -224,17 +240,20 @@ static __inline__ void vlc_thread_exit( void ) ...@@ -224,17 +240,20 @@ static __inline__ void vlc_thread_exit( void )
*****************************************************************************/ *****************************************************************************/
static __inline__ void vlc_thread_join( vlc_thread_t thread ) static __inline__ void vlc_thread_join( vlc_thread_t thread )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
pth_join( thread, NULL );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_join( thread, NULL ); pthread_join( thread, NULL );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
cthread_join( thread ); cthread_join( thread );
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
int32 exit_value; int32 exit_value;
wait_for_thread( thread, &exit_value ); wait_for_thread( thread, &exit_value );
#elif defined(WIN32) #elif defined( WIN32 )
WaitForSingleObject( thread, INFINITE); WaitForSingleObject( thread, INFINITE);
#endif #endif
...@@ -245,14 +264,17 @@ static __inline__ void vlc_thread_join( vlc_thread_t thread ) ...@@ -245,14 +264,17 @@ static __inline__ void vlc_thread_join( vlc_thread_t thread )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return pth_mutex_init( p_mutex );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_init( p_mutex, NULL ); return pthread_mutex_init( p_mutex, NULL );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
mutex_init( p_mutex ); mutex_init( p_mutex );
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
/* check the arguments and whether it's already been initialized */ /* check the arguments and whether it's already been initialized */
if( p_mutex == NULL ) if( p_mutex == NULL )
...@@ -274,7 +296,7 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex ) ...@@ -274,7 +296,7 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
p_mutex->init = 9999; p_mutex->init = 9999;
return B_OK; return B_OK;
#elif defined(WIN32) #elif defined( WIN32 )
*p_mutex = CreateMutex(0,FALSE,0); *p_mutex = CreateMutex(0,FALSE,0);
return (*p_mutex?0:1); return (*p_mutex?0:1);
...@@ -286,14 +308,17 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex ) ...@@ -286,14 +308,17 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return pth_mutex_acquire( p_mutex, TRUE, NULL );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_lock( p_mutex ); return pthread_mutex_lock( p_mutex );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
mutex_lock( p_mutex ); mutex_lock( p_mutex );
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
status_t err; status_t err;
if( !p_mutex ) if( !p_mutex )
...@@ -309,7 +334,7 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex ) ...@@ -309,7 +334,7 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
err = acquire_sem( p_mutex->lock ); err = acquire_sem( p_mutex->lock );
return err; return err;
#elif defined(WIN32) #elif defined( WIN32 )
WaitForSingleObject( *p_mutex, INFINITE ); WaitForSingleObject( *p_mutex, INFINITE );
return 0; return 0;
...@@ -321,14 +346,17 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex ) ...@@ -321,14 +346,17 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return pth_mutex_release( p_mutex );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_unlock( p_mutex ); return pthread_mutex_unlock( p_mutex );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
mutex_unlock( p_mutex ); mutex_unlock( p_mutex );
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_mutex) if( !p_mutex)
{ {
return B_BAD_VALUE; return B_BAD_VALUE;
...@@ -342,7 +370,7 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex ) ...@@ -342,7 +370,7 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
release_sem( p_mutex->lock ); release_sem( p_mutex->lock );
return B_OK; return B_OK;
#elif defined(WIN32) #elif defined( WIN32 )
ReleaseMutex( *p_mutex ); ReleaseMutex( *p_mutex );
return 0; return 0;
...@@ -354,10 +382,13 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex ) ...@@ -354,10 +382,13 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex ) static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return 0;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_destroy( p_mutex ); return pthread_mutex_destroy( p_mutex );
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
if( p_mutex->init == 9999 ) if( p_mutex->init == 9999 )
{ {
delete_sem( p_mutex->lock ); delete_sem( p_mutex->lock );
...@@ -366,7 +397,7 @@ static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex ) ...@@ -366,7 +397,7 @@ static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex )
p_mutex->init = 0; p_mutex->init = 0;
return B_OK; return B_OK;
#elif defined(WIN32) #elif defined( WIN32 )
CloseHandle(*p_mutex); CloseHandle(*p_mutex);
return 0; return 0;
...@@ -378,10 +409,13 @@ static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex ) ...@@ -378,10 +409,13 @@ static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar ) static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return pth_cond_init( p_condvar );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_init( p_condvar, NULL ); return pthread_cond_init( p_condvar, NULL );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
/* condition_init() */ /* condition_init() */
spin_lock_init( &p_condvar->lock ); spin_lock_init( &p_condvar->lock );
cthread_queue_init( &p_condvar->queue ); cthread_queue_init( &p_condvar->queue );
...@@ -390,7 +424,7 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar ) ...@@ -390,7 +424,7 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_condvar ) if( !p_condvar )
{ {
return B_BAD_VALUE; return B_BAD_VALUE;
...@@ -405,7 +439,7 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar ) ...@@ -405,7 +439,7 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
p_condvar->init = 9999; p_condvar->init = 9999;
return 0; return 0;
#elif defined(WIN32) #elif defined( WIN32 )
/* Create an auto-reset event. */ /* Create an auto-reset event. */
*p_condvar = CreateEvent( NULL, /* no security */ *p_condvar = CreateEvent( NULL, /* no security */
FALSE, /* auto-reset event */ FALSE, /* auto-reset event */
...@@ -422,10 +456,13 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar ) ...@@ -422,10 +456,13 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar ) static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return pth_cond_notify( p_condvar, FALSE );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_signal( p_condvar ); return pthread_cond_signal( p_condvar );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
/* condition_signal() */ /* condition_signal() */
if ( p_condvar->queue.head || p_condvar->implications ) if ( p_condvar->queue.head || p_condvar->implications )
{ {
...@@ -433,7 +470,7 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar ) ...@@ -433,7 +470,7 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
} }
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_condvar ) if( !p_condvar )
{ {
return B_BAD_VALUE; return B_BAD_VALUE;
...@@ -469,7 +506,7 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar ) ...@@ -469,7 +506,7 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
} }
return 0; return 0;
#elif defined(WIN32) #elif defined( WIN32 )
/* Try to release one waiting thread. */ /* Try to release one waiting thread. */
PulseEvent ( *p_condvar ); PulseEvent ( *p_condvar );
return 0; return 0;
...@@ -482,14 +519,17 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar ) ...@@ -482,14 +519,17 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex ) static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return pth_cond_await( p_condvar, p_mutex, NULL );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_wait( p_condvar, p_mutex ); return pthread_cond_wait( p_condvar, p_mutex );
#elif defined(HAVE_CTHREADS_H) #elif defined( HAVE_CTHREADS_H )
condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex ); condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex );
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_condvar ) if( !p_condvar )
{ {
return B_BAD_VALUE; return B_BAD_VALUE;
...@@ -516,7 +556,7 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex ...@@ -516,7 +556,7 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
vlc_mutex_lock( p_mutex ); vlc_mutex_lock( p_mutex );
return 0; return 0;
#elif defined(WIN32) #elif defined( WIN32 )
/* Release the <external_mutex> here and wait for the event /* Release the <external_mutex> here and wait for the event
* to become signaled, due to <pthread_cond_signal> being * to become signaled, due to <pthread_cond_signal> being
* called. */ * called. */
...@@ -536,14 +576,17 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex ...@@ -536,14 +576,17 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
*****************************************************************************/ *****************************************************************************/
static __inline__ int vlc_cond_destroy( vlc_cond_t *p_condvar ) static __inline__ int vlc_cond_destroy( vlc_cond_t *p_condvar )
{ {
#if defined(PTHREAD_COND_T_IN_PTHREAD_H) #if defined( PTH_INIT_IN_PTH_H )
return 0;
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_destroy( p_condvar ); return pthread_cond_destroy( p_condvar );
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined( HAVE_KERNEL_SCHEDULER_H )
p_condvar->init = 0; p_condvar->init = 0;
return 0; return 0;
#elif defined(WIN32) #elif defined( WIN32 )
CloseHandle( *p_condvar ); CloseHandle( *p_condvar );
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_directx.c: Windows DirectX audio output method * aout_directx.c: Windows DirectX audio output method
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: aout_directx.c,v 1.2 2001/06/03 12:47:21 sam Exp $ * $Id: aout_directx.c,v 1.3 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define MODULE_NAME directx #define MODULE_NAME directx
#include "modules_inner.h" #include "modules_inner.h"
/* The most important this to do for now is to fix the audio bug we've got /* The most important thing to do for now is to fix the audio bug we've got
* on startup: the audio will start later than the video (sometimes) and * on startup: the audio will start later than the video (sometimes) and
* is trying to catching up with it. * is trying to catching up with it.
* At first sight it seems to be a scheduling problem * At first sight it seems to be a scheduling problem
...@@ -77,6 +77,8 @@ typedef struct aout_sys_s ...@@ -77,6 +77,8 @@ typedef struct aout_sys_s
* takes care of mixing all the * takes care of mixing all the
* secondary buffers into the primary) */ * secondary buffers into the primary) */
HINSTANCE hdsound_dll; /* handle of the opened dsound dll */
long l_buffer_size; /* secondary sound buffer size */ long l_buffer_size; /* secondary sound buffer size */
long l_write_position; /* next write position for the buffer */ long l_write_position; /* next write position for the buffer */
...@@ -96,7 +98,8 @@ static void aout_Play ( aout_thread_t *p_aout, ...@@ -96,7 +98,8 @@ static void aout_Play ( aout_thread_t *p_aout,
static void aout_Close ( aout_thread_t *p_aout ); static void aout_Close ( aout_thread_t *p_aout );
/* local function */ /* local function */
static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout ); static int DirectxCreateSecondaryBuffer( aout_thread_t *p_aout );
static int DirectxInitDSound( aout_thread_t *p_aout );
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
...@@ -135,11 +138,11 @@ static int aout_Probe( probedata_t *p_data ) ...@@ -135,11 +138,11 @@ static int aout_Probe( probedata_t *p_data )
*****************************************************************************/ *****************************************************************************/
static int aout_Open( aout_thread_t *p_aout ) static int aout_Open( aout_thread_t *p_aout )
{ {
#if 0
HRESULT dsresult; HRESULT dsresult;
DSBUFFERDESC dsbuffer_desc; DSBUFFERDESC dsbuffer_desc;
WAVEFORMATEX waveformat; WAVEFORMATEX waveformat;
#endif
intf_WarnMsg( 3, "aout: DirectX aout_Open ");
/* Allocate structure */ /* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) ); p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
...@@ -162,32 +165,13 @@ static int aout_Open( aout_thread_t *p_aout ) ...@@ -162,32 +165,13 @@ static int aout_Open( aout_thread_t *p_aout )
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
AOUT_RATE_DEFAULT ); AOUT_RATE_DEFAULT );
/* Create the direct sound object */ /* Initialise DirectSound */
if( DirectSoundCreate(NULL, &p_aout->p_sys->p_dsobject, NULL) != DS_OK ) if( DirectxInitDSound( p_aout ) )
{ {
intf_WarnMsg( 3, "aout: can't create a direct sound device "); intf_WarnMsg( 3, "aout: can't initialise DirectSound ");
p_aout->p_sys->p_dsobject = NULL;
return( 1 ); return( 1 );
} }
/* Set DirectSound Cooperative level, ie what control we want over Windows
* sound device. In our case, DSSCL_EXCLUSIVE means that we can modify the
* settings of the primary buffer, but also that only the sound of our
* application will be hearable when it will have the focus.
* !!! (this is not really working as intended yet because to set the
* cooperative level you need the window handle of your application, and
* I don't know of any easy way to get it. Especially since we might play
* sound without any video, and so what window handle should we use ???
* The hack for now is to use the Desktop window handle - it seems to be
* working */
if( IDirectSound_SetCooperativeLevel(p_aout->p_sys->p_dsobject,
GetDesktopWindow(),
DSSCL_EXCLUSIVE) )
{
intf_WarnMsg( 3, "aout: can't set direct sound cooperative level ");
}
#if 0
/* Obtain (not create) Direct Sound primary buffer */ /* Obtain (not create) Direct Sound primary buffer */
memset( &dsbuffer_desc, 0, sizeof(DSBUFFERDESC) ); memset( &dsbuffer_desc, 0, sizeof(DSBUFFERDESC) );
dsbuffer_desc.dwSize = sizeof(DSBUFFERDESC); dsbuffer_desc.dwSize = sizeof(DSBUFFERDESC);
...@@ -240,21 +224,6 @@ static int aout_Open( aout_thread_t *p_aout ) ...@@ -240,21 +224,6 @@ static int aout_Open( aout_thread_t *p_aout )
p_aout->p_sys->p_dsbuffer_primary = NULL; p_aout->p_sys->p_dsbuffer_primary = NULL;
return( 1 ); return( 1 );
} }
#endif
/* Now create the buffer that we'll actually use: the secondary buffer */
if( windx_CreateSecondaryBuffer( p_aout ) )
{
intf_WarnMsg( 3, "aout: can't create direct sound secondary buffer ");
#if 0
IDirectSound_Release( p_aout->p_sys->p_dsbuffer_primary );
#endif
IDirectSound_Release( p_aout->p_sys->p_dsobject );
p_aout->p_sys->p_dsobject = NULL;
p_aout->p_sys->p_dsbuffer_primary = NULL;
p_aout->p_sys->p_dsbuffer = NULL;
return( 1 );
}
return( 0 ); return( 0 );
} }
...@@ -270,6 +239,8 @@ static int aout_SetFormat( aout_thread_t *p_aout ) ...@@ -270,6 +239,8 @@ static int aout_SetFormat( aout_thread_t *p_aout )
{ {
HRESULT dsresult; HRESULT dsresult;
intf_WarnMsg( 3, "aout: DirectX aout_SetFormat ");
/* first release the current secondary buffer */ /* first release the current secondary buffer */
if( p_aout->p_sys->p_dsbuffer != NULL ) if( p_aout->p_sys->p_dsbuffer != NULL )
{ {
...@@ -278,10 +249,10 @@ static int aout_SetFormat( aout_thread_t *p_aout ) ...@@ -278,10 +249,10 @@ static int aout_SetFormat( aout_thread_t *p_aout )
} }
/* then create a new secondary buffer */ /* then create a new secondary buffer */
dsresult = windx_CreateSecondaryBuffer( p_aout ); dsresult = DirectxCreateSecondaryBuffer( p_aout );
if( dsresult != DS_OK ) if( dsresult != DS_OK )
{ {
intf_WarnMsg( 3, "aout: WinDX aout_SetFormat cannot create buffer"); intf_WarnMsg( 3, "aout: DirectX aout_SetFormat cannot create buffer");
return( 1 ); return( 1 );
} }
...@@ -311,16 +282,25 @@ static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit ) ...@@ -311,16 +282,25 @@ static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
} }
if( dsresult != DS_OK ) if( dsresult != DS_OK )
{ {
intf_WarnMsg( 3, "aout: WinDX aout_GetBufInfo cannot get current pos"); intf_WarnMsg(3,"aout: DirectX aout_GetBufInfo cannot get current pos");
return( l_buffer_limit ); return( l_buffer_limit );
} }
l_result = ((p_aout->p_sys->l_write_position >= l_play_position) ? /* temporary hack. When you start playing a new file, the play position
(p_aout->p_sys->l_write_position - l_play_position)/2 * doesn't start changing immediatly, even though sound is already
: (p_aout->p_sys->l_buffer_size - l_play_position * playing from the sound card */
+ p_aout->p_sys->l_write_position)/2 ); if( l_play_position == 0 )
{
intf_WarnMsg( 5, "aout: DirectX aout_GetBufInfo: %li", l_buffer_limit);
return( l_buffer_limit );
}
l_result = (p_aout->p_sys->l_write_position >= l_play_position) ?
(p_aout->p_sys->l_write_position - l_play_position) /2
: (p_aout->p_sys->l_buffer_size - l_play_position
+ p_aout->p_sys->l_write_position) /2 ;
intf_WarnMsg( 5, "aout: WinDX aout_GetBufInfo: %li", l_result); intf_WarnMsg( 5, "aout: DirectX aout_GetBufInfo: %li", l_result);
return l_result; return l_result;
} }
...@@ -336,7 +316,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size ) ...@@ -336,7 +316,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
long l_play_position, l_notused, l_buffer_free_length; long l_play_position, l_notused, l_buffer_free_length;
HRESULT dsresult; HRESULT dsresult;
/* We want to copy data to the circular sound buffer, so first we need to /* We want to copy data to the circular sound buffer, so we first need to
* find out were in the buffer we can write our data */ * find out were in the buffer we can write our data */
dsresult = IDirectSoundBuffer_GetCurrentPosition(p_aout->p_sys->p_dsbuffer, dsresult = IDirectSoundBuffer_GetCurrentPosition(p_aout->p_sys->p_dsbuffer,
&l_play_position, &l_play_position,
...@@ -351,20 +331,31 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size ) ...@@ -351,20 +331,31 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
} }
if( dsresult != DS_OK ) if( dsresult != DS_OK )
{ {
intf_WarnMsg( 3, "aout: WinDX aout_Play can'get buffer position"); intf_WarnMsg( 3, "aout: DirectX aout_Play can'get buffer position");
} }
/* check that we are not overflowing the circular buffer (everything should /* check that we are not overflowing the circular buffer (everything should
* be alright but just in case) */ * be alright but just in case) */
l_buffer_free_length = l_play_position - p_aout->p_sys->l_write_position; l_buffer_free_length = l_play_position - p_aout->p_sys->l_write_position;
if( l_buffer_free_length <= 0 ) if( l_buffer_free_length <= 0 )
l_buffer_free_length += p_aout->p_sys->l_buffer_size ; l_buffer_free_length += p_aout->p_sys->l_buffer_size;
if( i_size > l_buffer_free_length ) if( i_size > l_buffer_free_length )
{ {
intf_WarnMsg( 3, "aout: WinDX aout_Play buffer overflow: size %i, free %i !!!", i_size, l_buffer_free_length); intf_WarnMsg( 3, "aout: DirectX aout_Play buffer overflow: size %i, free %i !!!", i_size, l_buffer_free_length);
intf_WarnMsg( 3, "aout: WinDX aout_Play buffer overflow: writepos %i, readpos %i !!!", l_play_position, p_aout->p_sys->l_write_position); intf_WarnMsg( 3, "aout: DirectX aout_Play buffer overflow: writepos %i, readpos %i !!!", p_aout->p_sys->l_write_position, l_play_position);
/*i_size = l_buffer_free_length;*/ /*i_size = l_buffer_free_length;*/
/* Update the write pointer */
p_aout->p_sys->l_write_position = l_notused;
}
else
{
intf_WarnMsg( 4, "aout: DirectX aout_Play buffer: size %i, free %i !!!"
, i_size, l_buffer_free_length);
intf_WarnMsg( 4, "aout: DirectX aout_Play buffer: writepos %i, readpos %i !!!", p_aout->p_sys->l_write_position, l_play_position);
} }
/* Before copying anything, we have to lock the buffer */ /* Before copying anything, we have to lock the buffer */
...@@ -391,7 +382,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size ) ...@@ -391,7 +382,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
} }
if( dsresult != DS_OK ) if( dsresult != DS_OK )
{ {
intf_WarnMsg( 3, "aout: WinDX aout_Play can't lock buffer"); intf_WarnMsg( 3, "aout: DirectX aout_Play can't lock buffer");
return; return;
} }
...@@ -423,7 +414,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size ) ...@@ -423,7 +414,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
} }
if( dsresult != DS_OK ) if( dsresult != DS_OK )
{ {
intf_WarnMsg( 3, "aout: WinDX aout_Play can't play buffer"); intf_WarnMsg( 3, "aout: DirectX aout_Play can't play buffer");
return; return;
} }
...@@ -434,6 +425,9 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size ) ...@@ -434,6 +425,9 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
*****************************************************************************/ *****************************************************************************/
static void aout_Close( aout_thread_t *p_aout ) static void aout_Close( aout_thread_t *p_aout )
{ {
intf_WarnMsg( 3, "aout: DirectX aout_Close ");
/* make sure the buffer isn't playing */ /* make sure the buffer isn't playing */
if( p_aout->p_sys->p_dsbuffer != NULL ) if( p_aout->p_sys->p_dsbuffer != NULL )
{ {
...@@ -461,6 +455,13 @@ static void aout_Close( aout_thread_t *p_aout ) ...@@ -461,6 +455,13 @@ static void aout_Close( aout_thread_t *p_aout )
p_aout->p_sys->p_dsobject = NULL; p_aout->p_sys->p_dsobject = NULL;
} }
/* free DSOUND.DLL */
if( p_aout->p_sys->hdsound_dll != NULL )
{
FreeLibrary( p_aout->p_sys->hdsound_dll );
p_aout->p_sys->hdsound_dll = NULL;
}
/* Close the Output. */ /* Close the Output. */
if ( p_aout->p_sys != NULL ) if ( p_aout->p_sys != NULL )
{ {
...@@ -470,7 +471,63 @@ static void aout_Close( aout_thread_t *p_aout ) ...@@ -470,7 +471,63 @@ static void aout_Close( aout_thread_t *p_aout )
} }
/***************************************************************************** /*****************************************************************************
* windx_CreateSecondaryBuffer * DirectxInitDSound
*****************************************************************************
*****************************************************************************/
static int DirectxInitDSound( aout_thread_t *p_aout )
{
HRESULT (WINAPI *OurDirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
p_aout->p_sys->hdsound_dll = LoadLibrary("DSOUND.DLL");
if( p_aout->p_sys->hdsound_dll == NULL )
{
intf_WarnMsg( 3, "aout: can't open DSOUND.DLL ");
return( 1 );
}
OurDirectSoundCreate = (void *)GetProcAddress( p_aout->p_sys->hdsound_dll,
"DirectSoundCreate" );
if( OurDirectSoundCreate == NULL )
{
intf_WarnMsg( 3, "aout: GetProcAddress FAILED ");
FreeLibrary( p_aout->p_sys->hdsound_dll );
p_aout->p_sys->hdsound_dll = NULL;
return( 1 );
}
/* Create the direct sound object */
if( OurDirectSoundCreate(NULL, &p_aout->p_sys->p_dsobject, NULL) != DS_OK )
{
intf_WarnMsg( 3, "aout: can't create a direct sound device ");
p_aout->p_sys->p_dsobject = NULL;
FreeLibrary( p_aout->p_sys->hdsound_dll );
p_aout->p_sys->hdsound_dll = NULL;
return( 1 );
}
/* Set DirectSound Cooperative level, ie what control we want over Windows
* sound device. In our case, DSSCL_EXCLUSIVE means that we can modify the
* settings of the primary buffer, but also that only the sound of our
* application will be hearable when it will have the focus.
* !!! (this is not really working as intended yet because to set the
* cooperative level you need the window handle of your application, and
* I don't know of any easy way to get it. Especially since we might play
* sound without any video, and so what window handle should we use ???
* The hack for now is to use the Desktop window handle - it seems to be
* working */
if( IDirectSound_SetCooperativeLevel(p_aout->p_sys->p_dsobject,
GetDesktopWindow(),
DSSCL_EXCLUSIVE) )
{
intf_WarnMsg( 3, "aout: can't set direct sound cooperative level ");
}
return( 0 );
}
/*****************************************************************************
* DirectxCreateSecondaryBuffer
***************************************************************************** *****************************************************************************
* This function creates the buffer we'll use to play audio. * This function creates the buffer we'll use to play audio.
* In DirectSound there are two kinds of buffers: * In DirectSound there are two kinds of buffers:
...@@ -481,7 +538,7 @@ static void aout_Close( aout_thread_t *p_aout ) ...@@ -481,7 +538,7 @@ static void aout_Close( aout_thread_t *p_aout )
* Once you create a secondary buffer, you cannot change its format anymore so * Once you create a secondary buffer, you cannot change its format anymore so
* you have to release the current and create another one. * you have to release the current and create another one.
*****************************************************************************/ *****************************************************************************/
static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout ) static int DirectxCreateSecondaryBuffer( aout_thread_t *p_aout )
{ {
WAVEFORMATEX waveformat; WAVEFORMATEX waveformat;
DSBUFFERDESC dsbdesc; DSBUFFERDESC dsbdesc;
...@@ -504,10 +561,6 @@ static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout ) ...@@ -504,10 +561,6 @@ static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout )
dsbdesc.dwSize = sizeof(DSBUFFERDESC); dsbdesc.dwSize = sizeof(DSBUFFERDESC);
dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2/* Better position accuracy */ dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2/* Better position accuracy */
| DSBCAPS_GLOBALFOCUS; /* Allows background playing */ | DSBCAPS_GLOBALFOCUS; /* Allows background playing */
/* | DSBCAPS_CTRLPAN
| DSBCAPS_CTRLVOLUME
| DSBCAPS_CTRLFREQUENCY;
*/
dsbdesc.dwBufferBytes = waveformat.nAvgBytesPerSec * 4; /* 4 sec buffer */ dsbdesc.dwBufferBytes = waveformat.nAvgBytesPerSec * 4; /* 4 sec buffer */
dsbdesc.lpwfxFormat = &waveformat; dsbdesc.lpwfxFormat = &waveformat;
...@@ -523,32 +576,12 @@ static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout ) ...@@ -523,32 +576,12 @@ static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout )
/* backup the size of the secondary sound buffer */ /* backup the size of the secondary sound buffer */
memset(&dsbcaps, 0, sizeof(DSBCAPS)); memset(&dsbcaps, 0, sizeof(DSBCAPS));
dsbcaps.dwSize = sizeof(DSBCAPS); dsbcaps.dwSize = sizeof(DSBCAPS);
IDirectSoundBuffer_GetCaps( p_aout->p_sys->p_dsbuffer, &dsbcaps ); IDirectSoundBuffer_GetCaps( p_aout->p_sys->p_dsbuffer, &dsbcaps );
p_aout->p_sys->l_buffer_size = dsbcaps.dwBufferBytes; p_aout->p_sys->l_buffer_size = dsbcaps.dwBufferBytes;
p_aout->p_sys->l_write_position = 0; p_aout->p_sys->l_write_position = 0;
intf_WarnMsg( 3, "aout: WinDX WinDX_CreateSecondaryBuffer: %li", intf_WarnMsg( 3, "aout: DirectX DirectxCreateSecondaryBuffer: %li",
p_aout->p_sys->l_buffer_size); p_aout->p_sys->l_buffer_size);
/* make sure the buffer isn't playing */
IDirectSoundBuffer_Stop( p_aout->p_sys->p_dsbuffer );
/* reset play position, just to be sure (and after some tests it seems
* indeed necessary */
dsresult = IDirectSoundBuffer_SetCurrentPosition(p_aout->p_sys->p_dsbuffer,
0 );
if( dsresult == DSERR_BUFFERLOST )
{
IDirectSoundBuffer_Restore( p_aout->p_sys->p_dsbuffer );
dsresult = IDirectSoundBuffer_SetCurrentPosition(
p_aout->p_sys->p_dsbuffer,
0 );
}
if( dsresult != DS_OK )
{
intf_WarnMsg( 3, "aout: WinDX CreateSecondary cannot wet current pos");
}
return( 0 ); return( 0 );
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_directx.c: Windows DirectX video output display method * vout_directx.c: Windows DirectX video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_directx.c,v 1.3 2001/06/08 20:03:15 sam Exp $ * $Id: vout_directx.c,v 1.4 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -82,10 +82,11 @@ ...@@ -82,10 +82,11 @@
typedef struct vout_sys_s typedef struct vout_sys_s
{ {
LPDIRECTDRAW p_ddobject; /* DirectDraw object */ LPDIRECTDRAW2 p_ddobject; /* DirectDraw object */
LPDIRECTDRAWSURFACE p_display; /* display device */ LPDIRECTDRAWSURFACE3 p_display; /* Display device */
LPDIRECTDRAWSURFACE p_overlay; /* overlay device */ LPDIRECTDRAWSURFACE3 p_surface; /* surface where we display the video */
LPDIRECTDRAWCLIPPER p_clipper; /* clipper */ LPDIRECTDRAWCLIPPER p_clipper; /* clipper used for blitting */
HINSTANCE hddraw_dll; /* handle of the opened ddraw dll */
HBRUSH hbrush; /* window backgound brush (color) */ HBRUSH hbrush; /* window backgound brush (color) */
HWND hwnd; /* Handle of the main window */ HWND hwnd; /* Handle of the main window */
...@@ -103,7 +104,7 @@ typedef struct vout_sys_s ...@@ -103,7 +104,7 @@ typedef struct vout_sys_s
boolean_t b_cursor_autohidden; boolean_t b_cursor_autohidden;
mtime_t i_lastmoved; mtime_t i_lastmoved;
char *p_windx_buf[2]; /* Buffer information */ char *p_directx_buf[2]; /* Buffer information */
} vout_sys_t; } vout_sys_t;
...@@ -120,15 +121,16 @@ static void vout_Display ( struct vout_thread_s * ); ...@@ -120,15 +121,16 @@ static void vout_Display ( struct vout_thread_s * );
static void vout_SetPalette( p_vout_thread_t p_vout, u16 *red, u16 *green, static void vout_SetPalette( p_vout_thread_t p_vout, u16 *red, u16 *green,
u16 *blue, u16 *transp ); u16 *blue, u16 *transp );
static int WinDXCreateWindow ( vout_thread_t *p_vout ); static int DirectXCreateWindow ( vout_thread_t *p_vout );
static int WinDXInitDDraw ( vout_thread_t *p_vout ); static int DirectXInitDDraw ( vout_thread_t *p_vout );
static int WinDXCreateDisplay ( vout_thread_t *p_vout ); static int DirectXCreateDisplay ( vout_thread_t *p_vout );
static int WinDXCreateYUVOverlay ( vout_thread_t *p_vout ); static int DirectXCreateSurface ( vout_thread_t *p_vout );
static int WinDXUpdateOverlay ( vout_thread_t *p_vout ); static int DirectXCreateClipper ( vout_thread_t *p_vout );
static void WinDXCloseDDraw ( vout_thread_t *p_vout ); static int DirectXUpdateOverlay ( vout_thread_t *p_vout );
static void WinDXCloseWindow ( vout_thread_t *p_vout ); static void DirectXCloseDDraw ( vout_thread_t *p_vout );
static void WinDXCloseDisplay ( vout_thread_t *p_vout ); static void DirectXCloseWindow ( vout_thread_t *p_vout );
static void WinDXCloseYUVOverlay ( vout_thread_t *p_vout ); static void DirectXCloseDisplay ( vout_thread_t *p_vout );
static void DirectXCloseSurface ( vout_thread_t *p_vout );
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
...@@ -154,11 +156,15 @@ void _M( vout_getfunctions )( function_list_t * p_function_list ) ...@@ -154,11 +156,15 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
*****************************************************************************/ *****************************************************************************/
static int vout_Probe( probedata_t *p_data ) static int vout_Probe( probedata_t *p_data )
{ {
if( TestMethod( VOUT_METHOD_VAR, "directx" ) ) if( TestMethod( VOUT_METHOD_VAR, "directx" ) )
{ {
return( 999 ); return( 999 );
} }
/* Check that at least DirectX5 is installed on the computer */
/* Fixme */
return( 400 ); return( 400 );
} }
...@@ -180,15 +186,16 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -180,15 +186,16 @@ static int vout_Create( vout_thread_t *p_vout )
/* Initialisations */ /* Initialisations */
p_vout->p_sys->p_ddobject = NULL; p_vout->p_sys->p_ddobject = NULL;
p_vout->p_sys->p_display = NULL; p_vout->p_sys->p_display = NULL;
p_vout->p_sys->p_overlay = NULL; p_vout->p_sys->p_surface = NULL;
p_vout->p_sys->p_clipper = NULL; p_vout->p_sys->p_clipper = NULL;
p_vout->p_sys->hbrush = INVALID_HANDLE_VALUE; p_vout->p_sys->hbrush = NULL;
p_vout->p_sys->hwnd = INVALID_HANDLE_VALUE; p_vout->p_sys->hwnd = NULL;
p_vout->p_sys->b_display_enabled = 0;
p_vout->b_need_render = 0; /* by default try an YUV overlay display */
p_vout->p_sys->b_cursor = 1; /* TODO should be done with a main_GetInt.. */ p_vout->p_sys->b_cursor = 1; /* TODO should be done with a main_GetInt.. */
p_vout->p_sys->b_cursor_autohidden = 0; p_vout->p_sys->b_cursor_autohidden = 0;
p_vout->p_sys->b_display_enabled = 0;
p_vout->p_sys->i_lastmoved = mdate(); p_vout->p_sys->i_lastmoved = mdate();
p_vout->b_fullscreen = main_GetIntVariable( VOUT_FULLSCREEN_VAR, p_vout->b_fullscreen = main_GetIntVariable( VOUT_FULLSCREEN_VAR,
...@@ -207,7 +214,7 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -207,7 +214,7 @@ static int vout_Create( vout_thread_t *p_vout )
/* Create a window for the video */ /* Create a window for the video */
/* Creating a window under Windows also initializes the thread's event /* Creating a window under Windows also initializes the thread's event
* message qeue */ * message qeue */
if( WinDXCreateWindow( p_vout ) ) if( DirectXCreateWindow( p_vout ) )
{ {
intf_ErrMsg( "vout error: can't create window" ); intf_ErrMsg( "vout error: can't create window" );
free( p_vout->p_sys ); free( p_vout->p_sys );
...@@ -215,20 +222,20 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -215,20 +222,20 @@ static int vout_Create( vout_thread_t *p_vout )
} }
/* Initialise DirectDraw */ /* Initialise DirectDraw */
if( WinDXInitDDraw( p_vout ) ) if( DirectXInitDDraw( p_vout ) )
{ {
intf_ErrMsg( "vout error: can't initialise DirectDraw" ); intf_ErrMsg( "vout error: can't initialise DirectDraw" );
WinDXCloseWindow( p_vout ); DirectXCloseWindow( p_vout );
free( p_vout->p_sys ); free( p_vout->p_sys );
return ( 1 ); return ( 1 );
} }
/* create the directx display */ /* Create the directx display */
if( WinDXCreateDisplay( p_vout ) ) if( DirectXCreateDisplay( p_vout ) )
{ {
intf_ErrMsg( "vout error: can't initialise DirectDraw" ); intf_ErrMsg( "vout error: can't initialise DirectDraw" );
WinDXCloseDDraw( p_vout ); DirectXCloseDDraw( p_vout );
WinDXCloseWindow( p_vout ); DirectXCloseWindow( p_vout );
free( p_vout->p_sys ); free( p_vout->p_sys );
return ( 1 ); return ( 1 );
} }
...@@ -265,9 +272,9 @@ static void vout_End( vout_thread_t *p_vout ) ...@@ -265,9 +272,9 @@ static void vout_End( vout_thread_t *p_vout )
static void vout_Destroy( vout_thread_t *p_vout ) static void vout_Destroy( vout_thread_t *p_vout )
{ {
intf_WarnMsg( 3, "vout: vout_Destroy" ); intf_WarnMsg( 3, "vout: vout_Destroy" );
WinDXCloseDisplay( p_vout ); DirectXCloseDisplay( p_vout );
WinDXCloseDDraw( p_vout ); DirectXCloseDDraw( p_vout );
WinDXCloseWindow( p_vout ); DirectXCloseWindow( p_vout );
if( p_vout->p_sys != NULL ) if( p_vout->p_sys != NULL )
{ {
...@@ -297,17 +304,17 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -297,17 +304,17 @@ static int vout_Manage( vout_thread_t *p_vout )
{ {
case WM_CLOSE: case WM_CLOSE:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_CLOSE" ); intf_WarnMsg( 4, "vout: vout_Manage WM_CLOSE" );
p_vout->b_die = 1; p_vout->b_die = 1;
break; break;
case WM_QUIT: case WM_QUIT:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_QUIT" ); intf_WarnMsg( 4, "vout: vout_Manage WM_QUIT" );
p_main->p_intf->b_die = 1; p_main->p_intf->b_die = 1;
break; break;
case WM_MOVE: case WM_MOVE:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_MOVE" ); intf_WarnMsg( 3, "vout: vout_Manage WM_MOVE" );
if( !p_vout->b_need_render ) if( !p_vout->b_need_render )
{ {
p_vout->i_changes |= VOUT_SIZE_CHANGE; p_vout->i_changes |= VOUT_SIZE_CHANGE;
...@@ -317,7 +324,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -317,7 +324,7 @@ static int vout_Manage( vout_thread_t *p_vout )
break; break;
case WM_APP: case WM_APP:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_APP" ); intf_WarnMsg( 3, "vout: vout_Manage WM_APP" );
if( !p_vout->b_need_render ) if( !p_vout->b_need_render )
{ {
p_vout->i_changes |= VOUT_SIZE_CHANGE; p_vout->i_changes |= VOUT_SIZE_CHANGE;
...@@ -327,18 +334,18 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -327,18 +334,18 @@ static int vout_Manage( vout_thread_t *p_vout )
break; break;
case WM_PAINT: case WM_PAINT:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_PAINT" ); intf_WarnMsg( 4, "vout: vout_Manage WM_PAINT" );
break; break;
case WM_ERASEBKGND: case WM_ERASEBKGND:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_ERASEBKGND" ); intf_WarnMsg( 4, "vout: vout_Manage WM_ERASEBKGND" );
break; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_MOUSEMOVE" ); intf_WarnMsg( 4, "vout: vout_Manage WM_MOUSEMOVE" );
if( p_vout->p_sys->b_cursor ) if( p_vout->p_sys->b_cursor )
{ {
if( p_vout->p_sys->b_cursor_autohidden ) if( p_vout->p_sys->b_cursor_autohidden )
{ {
p_vout->p_sys->b_cursor_autohidden = 0; p_vout->p_sys->b_cursor_autohidden = 0;
p_vout->p_sys->i_lastmoved = mdate(); p_vout->p_sys->i_lastmoved = mdate();
...@@ -355,7 +362,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -355,7 +362,7 @@ static int vout_Manage( vout_thread_t *p_vout )
/* the key events are first processed here. The next /* the key events are first processed here. The next
* message processed by this main message loop will be the * message processed by this main message loop will be the
* char translation of the key event */ * char translation of the key event */
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_KEYDOWN" ); intf_WarnMsg( 3, "vout: vout_Manage WM_KEYDOWN" );
switch( msg.wParam ) switch( msg.wParam )
{ {
case VK_ESCAPE: case VK_ESCAPE:
...@@ -368,7 +375,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -368,7 +375,7 @@ static int vout_Manage( vout_thread_t *p_vout )
break; break;
case WM_CHAR: case WM_CHAR:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_CHAR" ); intf_WarnMsg( 3, "vout: vout_Manage WM_CHAR" );
switch( msg.wParam ) switch( msg.wParam )
{ {
case 'q': case 'q':
...@@ -376,11 +383,39 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -376,11 +383,39 @@ static int vout_Manage( vout_thread_t *p_vout )
p_main->p_intf->b_die = 1; p_main->p_intf->b_die = 1;
break; break;
case 'f': case 'f': /* switch to fullscreen */
case 'F': case 'F':
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE; p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break; break;
case 'y': /* switch to hard YUV */
case 'Y':
p_vout->i_changes |= VOUT_YUV_CHANGE;
break;
case 'c': /* toggle grayscale */
case 'C':
p_vout->b_grayscale = ! p_vout->b_grayscale;
p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
break;
case 'i': /* toggle info */
case 'I':
p_vout->b_info = ! p_vout->b_info;
p_vout->i_changes |= VOUT_INFO_CHANGE;
break;
case 's': /* toggle scaling */
case 'S':
p_vout->b_scale = ! p_vout->b_scale;
p_vout->i_changes |= VOUT_SCALE_CHANGE;
break;
case ' ': /* toggle interface */
p_vout->b_interface = ! p_vout->b_interface;
p_vout->i_changes |= VOUT_INTF_CHANGE;
break;
case '0': network_ChannelJoin( 0 ); break; case '0': network_ChannelJoin( 0 ); break;
case '1': network_ChannelJoin( 1 ); break; case '1': network_ChannelJoin( 1 ); break;
case '2': network_ChannelJoin( 2 ); break; case '2': network_ChannelJoin( 2 ); break;
...@@ -403,7 +438,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -403,7 +438,7 @@ static int vout_Manage( vout_thread_t *p_vout )
} }
default: default:
intf_WarnMsg( 3, "vout: WinDX vout_Manage WM Default %i", intf_WarnMsg( 4, "vout: vout_Manage WM Default %i",
msg.message ); msg.message );
break; break;
} }
...@@ -425,16 +460,52 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -425,16 +460,52 @@ static int vout_Manage( vout_thread_t *p_vout )
} }
/*
* Scale Change
*/
if( p_vout->i_changes & VOUT_SCALE_CHANGE )
{
intf_WarnMsg( 3, "vout: vout_Manage Scale Change" );
DirectXUpdateOverlay( p_vout );
p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
}
/* /*
* Size Change * Size Change
*/ */
if( p_vout->i_changes & VOUT_SIZE_CHANGE ) if( p_vout->i_changes & VOUT_SIZE_CHANGE )
{ {
intf_WarnMsg( 3, "vout: WinDX vout_Manage Size Change" ); intf_WarnMsg( 3, "vout: vout_Manage Size Change" );
WinDXUpdateOverlay( p_vout ); DirectXUpdateOverlay( p_vout );
p_vout->i_changes &= ~VOUT_SIZE_CHANGE; p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
} }
/*
* YUV Change
*/
if( p_vout->i_changes & VOUT_YUV_CHANGE )
{
p_vout->b_need_render = ! p_vout->b_need_render;
/* Need to reopen display */
DirectXCloseSurface( p_vout );
if( DirectXCreateSurface( p_vout ) )
{
intf_ErrMsg( "error: can't reopen display after YUV change" );
return( 1 );
}
/* Repaint the window background (needed by the overlay surface) */
if( !p_vout->b_need_render )
{
InvalidateRect( p_vout->p_sys->hwnd, NULL, TRUE );
p_vout->p_sys->b_display_enabled = 1;
DirectXUpdateOverlay( p_vout );
}
p_vout->i_changes &= ~VOUT_YUV_CHANGE;
}
/* /*
* Fullscreen change * Fullscreen change
*/ */
...@@ -463,7 +534,6 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -463,7 +534,6 @@ static int vout_Manage( vout_thread_t *p_vout )
} }
SetWindowPlacement( p_vout->p_sys->hwnd, &window_placement ); SetWindowPlacement( p_vout->p_sys->hwnd, &window_placement );
/*WinDXUpdateOverlay( p_vout );*/
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE; p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
} }
...@@ -472,7 +542,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -472,7 +542,7 @@ static int vout_Manage( vout_thread_t *p_vout )
* Pointer change * Pointer change
*/ */
if( ! p_vout->p_sys->b_cursor_autohidden && if( ! p_vout->p_sys->b_cursor_autohidden &&
( mdate() - p_vout->p_sys->i_lastmoved > 2000000 ) ) ( mdate() - p_vout->p_sys->i_lastmoved > 5000000 ) )
{ {
/* Hide the mouse automatically */ /* Hide the mouse automatically */
p_vout->p_sys->b_cursor_autohidden = 1; p_vout->p_sys->b_cursor_autohidden = 1;
...@@ -517,22 +587,86 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -517,22 +587,86 @@ static void vout_Display( vout_thread_t *p_vout )
DDSURFACEDESC ddsd; DDSURFACEDESC ddsd;
HRESULT dxresult; HRESULT dxresult;
int i; int i;
int i_image_width = p_vout->p_rendered_pic->i_width; int i_image_width;
int i_image_height = p_vout->p_rendered_pic->i_height; int i_image_height;
intf_WarnMsg( 5, "vout: vout_Display" );
if( (p_vout->p_sys->p_display == NULL) ) if( (p_vout->p_sys->p_display == NULL) )
{ {
intf_WarnMsg( 3, "vout error: WinDX no display!!" ); intf_WarnMsg( 3, "vout error: vout_Display no display!!" );
return; return;
} }
/* The first time this function is called it enables the display */ /* The first time this function is called it enables the display */
p_vout->p_sys->b_display_enabled = 1; p_vout->p_sys->b_display_enabled = 1;
/* if the size of the decoded pictures has changed then we close the
* video surface (which doesn't have the right size anymore). */
i_image_width = ( p_vout->p_rendered_pic ) ?
p_vout->p_rendered_pic->i_width : p_vout->p_sys->i_image_width;
i_image_height = ( p_vout->p_rendered_pic ) ?
p_vout->p_rendered_pic->i_height : p_vout->p_sys->i_image_height;
if( p_vout->p_sys->i_image_width != i_image_width
|| p_vout->p_sys->i_image_height != i_image_height )
{
intf_WarnMsg( 3, "vout: video surface size changed" );
p_vout->p_sys->i_image_width = i_image_width;
p_vout->p_sys->i_image_height = i_image_height;
DirectXCloseSurface( p_vout );
}
if( p_vout->b_need_render ) if( p_vout->b_need_render )
{ {
RECT rect_window;
POINT point_window;
/* Nothing yet */ /* Nothing yet */
if( p_vout->p_sys->p_surface == NULL )
{
intf_WarnMsg( 3, "vout: no video surface, open one..." );
if( DirectXCreateSurface( p_vout ) )
{
intf_WarnMsg( 3, "vout: cannot open a new video surface !!" );
return;
}
/* Display the surface */
p_vout->p_sys->b_display_enabled = 1;
}
/* Now get the coordinates of the window. We don't actually want the
* window coordinates but these of the usable surface inside the window
* By specification GetClientRect will always set rect_window.left and
* rect_window.top to 0 because the Client area is always relative to
* the container window */
GetClientRect(p_vout->p_sys->hwnd, &rect_window);
point_window.x = 0;
point_window.y = 0;
ClientToScreen(p_vout->p_sys->hwnd, &point_window);
rect_window.left = point_window.x;
rect_window.top = point_window.y;
point_window.x = rect_window.right;
point_window.y = rect_window.bottom;
ClientToScreen(p_vout->p_sys->hwnd, &point_window);
rect_window.right = point_window.x;
rect_window.bottom = point_window.y;
/* Blit video surface to display */
dxresult = IDirectDrawSurface3_Blt(p_vout->p_sys->p_display,
&rect_window,
p_vout->p_sys->p_surface,
NULL,
0, NULL );
if( dxresult != DD_OK )
{
intf_WarnMsg( 3, "vout: could not Blit the surface" );
return;
}
} }
else else
{ {
...@@ -542,47 +676,36 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -542,47 +676,36 @@ static void vout_Display( vout_thread_t *p_vout )
*/ */
/* TODO: support for streams other than 4:2:0 */ /* TODO: support for streams other than 4:2:0 */
/* if the size of the decoded pictures has changed then we close the if( p_vout->p_sys->p_surface == NULL )
* YUVOverlay (which doesn't have the right size anymore). */
if( p_vout->p_sys->i_image_width != i_image_width
|| p_vout->p_sys->i_image_height != i_image_height )
{
intf_WarnMsg( 3, "vout: WinDX overlay size changed" );
p_vout->p_sys->i_image_width = i_image_width;
p_vout->p_sys->i_image_height = i_image_height;
WinDXCloseYUVOverlay( p_vout );
}
if( p_vout->p_sys->p_overlay == NULL )
{ {
intf_WarnMsg( 3, "vout: WinDX no overlay, open one..." ); intf_WarnMsg( 3, "vout: no video surface, open one..." );
if( WinDXCreateYUVOverlay( p_vout ) ) if( DirectXCreateSurface( p_vout ) )
{ {
intf_WarnMsg( 3, "vout: WinDX cannot open a new overlay !!" ); intf_WarnMsg( 3, "vout: cannot open a new video surface !!" );
return; return;
} }
/* Display the Overlay */ /* Display the Overlay */
p_vout->p_sys->b_display_enabled = 1; p_vout->p_sys->b_display_enabled = 1;
WinDXUpdateOverlay( p_vout ); DirectXUpdateOverlay( p_vout );
} }
/* Lock the overlay surface */ /* Lock the overlay surface */
memset( &ddsd, 0, sizeof( DDSURFACEDESC )); memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC); ddsd.dwSize = sizeof(DDSURFACEDESC);
dxresult = IDirectDrawSurface_Lock(p_vout->p_sys->p_overlay, NULL, dxresult = IDirectDrawSurface3_Lock(p_vout->p_sys->p_surface, NULL,
&ddsd, DDLOCK_NOSYSLOCK, NULL); &ddsd, DDLOCK_NOSYSLOCK, NULL);
if ( dxresult == DDERR_SURFACELOST ) if ( dxresult == DDERR_SURFACELOST )
{ {
/* Your surface can be lost (thanks to windows) so be sure /* Your surface can be lost (thanks to windows) so be sure
* to check this and restore it if needed */ * to check this and restore it if needed */
dxresult = IDirectDrawSurface_Restore( p_vout->p_sys->p_overlay ); dxresult = IDirectDrawSurface3_Restore( p_vout->p_sys->p_surface );
dxresult = IDirectDrawSurface_Lock( p_vout->p_sys->p_overlay, dxresult = IDirectDrawSurface3_Lock( p_vout->p_sys->p_surface,
NULL, &ddsd, DDLOCK_NOSYSLOCK NULL, &ddsd, DDLOCK_NOSYSLOCK
| DDLOCK_WAIT, NULL); | DDLOCK_WAIT, NULL);
} }
if( dxresult != DD_OK ) if( dxresult != DD_OK )
{ {
intf_WarnMsg( 3, "vout: WinDX could not lock the surface" ); intf_WarnMsg( 3, "vout: could not lock the surface" );
return; return;
} }
...@@ -634,8 +757,8 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -634,8 +757,8 @@ static void vout_Display( vout_thread_t *p_vout )
} }
/* Unlock the Surface */ /* Unlock the Surface */
dxresult = IDirectDrawSurface_Unlock(p_vout->p_sys->p_overlay, dxresult = IDirectDrawSurface3_Unlock(p_vout->p_sys->p_surface,
ddsd.lpSurface ); ddsd.lpSurface );
} }
...@@ -646,7 +769,7 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -646,7 +769,7 @@ static void vout_Display( vout_thread_t *p_vout )
/***************************************************************************** /*****************************************************************************
* WinDXEventProc: This is the window event processing function. * DirectXEventProc: This is the window event processing function.
***************************************************************************** *****************************************************************************
* On Windows, when you create a window you have to attach an event processing * On Windows, when you create a window you have to attach an event processing
* function to it. The aim of this function is to manage "Queued Messages" and * function to it. The aim of this function is to manage "Queued Messages" and
...@@ -656,28 +779,30 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -656,28 +779,30 @@ static void vout_Display( vout_thread_t *p_vout )
* Nonqueued Messages are those that Windows will send directly to this * Nonqueued Messages are those that Windows will send directly to this
* function (like WM_DESTROY, WM_WINDOWPOSCHANGED...) * function (like WM_DESTROY, WM_WINDOWPOSCHANGED...)
*****************************************************************************/ *****************************************************************************/
long FAR PASCAL WinDXEventProc( HWND hwnd, UINT message, long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam ) WPARAM wParam, LPARAM lParam )
{ {
switch( message ) switch( message )
{ {
#if 0
case WM_ACTIVATE: case WM_ACTIVATE:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_ACTIVED" ); intf_WarnMsg( 4, "vout: WinProc WM_ACTIVED" );
break; break;
case WM_CREATE: case WM_CREATE:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_CREATE" ); intf_WarnMsg( 4, "vout: WinProc WM_CREATE" );
break; break;
/* the user wants to close the window */ /* the user wants to close the window */
case WM_CLOSE: case WM_CLOSE:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_CLOSE" ); intf_WarnMsg( 4, "vout: WinProc WM_CLOSE" );
break; break;
#endif
/* the window has been closed so shut down everything now */ /* the window has been closed so shut down everything now */
case WM_DESTROY: case WM_DESTROY:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_DESTROY" ); intf_WarnMsg( 4, "vout: WinProc WM_DESTROY" );
PostQuitMessage( 0 ); PostQuitMessage( 0 );
break; break;
...@@ -686,60 +811,64 @@ long FAR PASCAL WinDXEventProc( HWND hwnd, UINT message, ...@@ -686,60 +811,64 @@ long FAR PASCAL WinDXEventProc( HWND hwnd, UINT message,
{ {
case SC_SCREENSAVE: /* catch the screensaver */ case SC_SCREENSAVE: /* catch the screensaver */
case SC_MONITORPOWER: /* catch the monitor turn-off */ case SC_MONITORPOWER: /* catch the monitor turn-off */
intf_WarnMsg( 3, "vout: WinDX WinProc WM_SYSCOMMAND" ); intf_WarnMsg( 3, "vout: WinProc WM_SYSCOMMAND" );
return 0; /* this stops them from happening */ return 0; /* this stops them from happening */
} }
break; break;
#if 0
case WM_MOVE: case WM_MOVE:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_MOVE" ); intf_WarnMsg( 4, "vout: WinProc WM_MOVE" );
break; break;
case WM_SIZE: case WM_SIZE:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_SIZE" ); intf_WarnMsg( 4, "vout: WinProc WM_SIZE" );
break; break;
case WM_MOVING: case WM_MOVING:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_MOVING" ); intf_WarnMsg( 4, "vout: WinProc WM_MOVING" );
break; break;
case WM_SIZING: case WM_SIZING:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_SIZING" ); intf_WarnMsg( 4, "vout: WinProc WM_SIZING" );
break; break;
#endif
case WM_WINDOWPOSCHANGED: case WM_WINDOWPOSCHANGED:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_WINDOWPOSCHANGED" ); intf_WarnMsg( 3, "vout: WinProc WM_WINDOWPOSCHANGED" );
PostMessage( NULL, WM_APP, 0, 0); PostMessage( NULL, WM_APP, 0, 0);
break; break;
#if 0
case WM_WINDOWPOSCHANGING: case WM_WINDOWPOSCHANGING:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_WINDOWPOSCHANGING" ); intf_WarnMsg( 3, "vout: WinProc WM_WINDOWPOSCHANGING" );
break; break;
case WM_PAINT: case WM_PAINT:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_PAINT" ); intf_WarnMsg( 4, "vout: WinProc WM_PAINT" );
break; break;
case WM_ERASEBKGND: case WM_ERASEBKGND:
intf_WarnMsg( 3, "vout: WinDX WinProc WM_ERASEBKGND" ); intf_WarnMsg( 4, "vout: WinProc WM_ERASEBKGND" );
break; break;
default: default:
intf_WarnMsg( 3, "vout: WinDX WinProc WM Default %i", message ); intf_WarnMsg( 4, "vout: WinProc WM Default %i", message );
break; break;
#endif
} }
return DefWindowProc(hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
/***************************************************************************** /*****************************************************************************
* WinDXCreateWindow: create a windows window where the video will play. * DirectXCreateWindow: create a windows window where the video will play.
***************************************************************************** *****************************************************************************
* Before creating a direct draw surface, we need to create a window in which * Before creating a direct draw surface, we need to create a window in which
* the video will be displayed. This window will also allow us to capture the * the video will be displayed. This window will also allow us to capture the
* events. * events.
*****************************************************************************/ *****************************************************************************/
static int WinDXCreateWindow( vout_thread_t *p_vout ) static int DirectXCreateWindow( vout_thread_t *p_vout )
{ {
HINSTANCE hInstance; HINSTANCE hInstance;
WNDCLASS wc; /* window class components */ WNDCLASS wc; /* window class components */
...@@ -770,7 +899,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout ) ...@@ -770,7 +899,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout )
if( colorkey == GetNearestColor( hdc, colorkey ) ) if( colorkey == GetNearestColor( hdc, colorkey ) )
break; break;
} }
intf_WarnMsg( 3, "vout: WinDXCreateWindow background color:%i", colorkey ); intf_WarnMsg(3,"vout: DirectXCreateWindow background color:%i", colorkey);
ReleaseDC( p_vout->p_sys->hwnd, hdc ); ReleaseDC( p_vout->p_sys->hwnd, hdc );
/* create the actual brush */ /* create the actual brush */
...@@ -779,7 +908,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout ) ...@@ -779,7 +908,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout )
/* fill in the window class structure */ /* fill in the window class structure */
wc.style = 0; /* no special styles */ wc.style = 0; /* no special styles */
wc.lpfnWndProc = (WNDPROC)WinDXEventProc; /* event handler */ wc.lpfnWndProc = (WNDPROC)DirectXEventProc; /* event handler */
wc.cbClsExtra = 0; /* no extra class data */ wc.cbClsExtra = 0; /* no extra class data */
wc.cbWndExtra = 0; /* no extra window data */ wc.cbWndExtra = 0; /* no extra window data */
wc.hInstance = hInstance; /* instance */ wc.hInstance = hInstance; /* instance */
...@@ -791,7 +920,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout ) ...@@ -791,7 +920,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout )
/* register the window class */ /* register the window class */
if (!RegisterClass(&wc)) { if (!RegisterClass(&wc)) {
intf_WarnMsg( 3, "vout: WinDX register window FAILED" ); intf_WarnMsg( 3, "vout: DirectXCreateWindow register window FAILED" );
return (1); return (1);
} }
...@@ -820,7 +949,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout ) ...@@ -820,7 +949,7 @@ static int WinDXCreateWindow( vout_thread_t *p_vout )
NULL); /* no additional arguments */ NULL); /* no additional arguments */
if (p_vout->p_sys->hwnd == NULL) { if (p_vout->p_sys->hwnd == NULL) {
intf_WarnMsg( 3, "vout: WinDX create window FAILED" ); intf_WarnMsg( 3, "vout: DirectXCreateWindow create window FAILED" );
return (1); return (1);
} }
...@@ -831,72 +960,107 @@ static int WinDXCreateWindow( vout_thread_t *p_vout ) ...@@ -831,72 +960,107 @@ static int WinDXCreateWindow( vout_thread_t *p_vout )
} }
/***************************************************************************** /*****************************************************************************
* WinDXInitDDraw: Takes care of all the DirectDraw initialisations * DirectXInitDDraw: Takes care of all the DirectDraw initialisations
***************************************************************************** *****************************************************************************
* This function initialise and allocate resources for DirectDraw. * This function initialise and allocate resources for DirectDraw.
*****************************************************************************/ *****************************************************************************/
static int WinDXInitDDraw( vout_thread_t *p_vout ) static int DirectXInitDDraw( vout_thread_t *p_vout )
{ {
HRESULT dxresult; HRESULT dxresult;
DWORD flags; HRESULT (WINAPI *OurDirectDrawCreate)(GUID *,LPDIRECTDRAW *,IUnknown *);
LPDIRECTDRAW p_ddobject;
intf_WarnMsg( 3, "vout: WinDX WinDXInitDDraw" ); intf_WarnMsg( 3, "vout: DirectXInitDDraw" );
/* Initialize DirectDraw */ /* load direct draw DLL */
dxresult = DirectDrawCreate( NULL, &p_vout->p_sys->p_ddobject, NULL ); p_vout->p_sys->hddraw_dll = LoadLibrary("DDRAW.DLL");
if( dxresult != DD_OK ) if( p_vout->p_sys->hddraw_dll == NULL )
{ {
intf_ErrMsg( "vout error: can't initialize Direct Draw" ); intf_WarnMsg( 3, "vout: DirectXInitDDraw failed loading ddraw.dll" );
return( 1 ); return( 1 );
} }
/* Set DirectDraw Cooperative level, ie what control we want over Windows OurDirectDrawCreate =
display */ (void *)GetProcAddress(p_vout->p_sys->hddraw_dll, "DirectDrawCreate");
if( p_vout->b_fullscreen ) if ( OurDirectDrawCreate == NULL )
{ {
flags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; intf_ErrMsg( "vout error: DirectXInitDDraw failed GetProcAddress" );
FreeLibrary( p_vout->p_sys->hddraw_dll );
p_vout->p_sys->hddraw_dll = NULL;
return( 1 );
} }
else
/* Initialize DirectDraw now */
dxresult = OurDirectDrawCreate( NULL, &p_ddobject, NULL );
if( dxresult != DD_OK )
{ {
flags = DDSCL_NORMAL; intf_ErrMsg( "vout error: DirectXInitDDraw can't initialize DDraw" );
p_vout->p_sys->p_ddobject = NULL;
FreeLibrary( p_vout->p_sys->hddraw_dll );
p_vout->p_sys->hddraw_dll = NULL;
return( 1 );
} }
dxresult = IDirectDraw_SetCooperativeLevel( p_vout->p_sys->p_ddobject, /* Set DirectDraw Cooperative level, ie what control we want over Windows
p_vout->p_sys->hwnd, flags ); * display */
dxresult = IDirectDraw_SetCooperativeLevel( p_ddobject,
p_vout->p_sys->hwnd, DDSCL_NORMAL );
if( dxresult != DD_OK ) if( dxresult != DD_OK )
{ {
intf_ErrMsg( "vout error: can't set direct draw cooperative level." ); intf_ErrMsg( "vout error: can't set direct draw cooperative level." );
IDirectDraw_Release(p_vout->p_sys->p_ddobject); IDirectDraw_Release( p_ddobject );
p_vout->p_sys->p_ddobject = NULL; p_vout->p_sys->p_ddobject = NULL;
FreeLibrary( p_vout->p_sys->hddraw_dll );
p_vout->p_sys->hddraw_dll = NULL;
return( 1 ); return( 1 );
} }
/* Get the IDirectDraw2 interface */
dxresult = IDirectDraw_QueryInterface( p_ddobject, &IID_IDirectDraw2,
(LPVOID *)&p_vout->p_sys->p_ddobject );
if( dxresult != DD_OK )
{
intf_ErrMsg( "vout error: can't get IDirectDraw2 interface." );
IDirectDraw_Release( p_ddobject );
p_vout->p_sys->p_ddobject = NULL;
FreeLibrary( p_vout->p_sys->hddraw_dll );
p_vout->p_sys->hddraw_dll = NULL;
return( 1 );
}
else
{
/* Release the unused interface */
IDirectDraw_Release( p_ddobject );
}
return( 0 ); return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* WinDXCreateDisplay: create the DirectDraw display. * DirectXCreateDisplay: create the DirectDraw display.
***************************************************************************** *****************************************************************************
* Create and initialize display according to preferences specified in the vout * Create and initialize display according to preferences specified in the vout
* thread fields. * thread fields.
*****************************************************************************/ *****************************************************************************/
static int WinDXCreateDisplay( vout_thread_t *p_vout ) static int DirectXCreateDisplay( vout_thread_t *p_vout )
{ {
DDCAPS ddcaps; HRESULT dxresult;
HRESULT dxresult; DDSURFACEDESC ddsd;
DDSURFACEDESC ddsd; LPDIRECTDRAWSURFACE p_display;
BOOL bHasOverlay, bHasColorKey, bCanStretch; DDPIXELFORMAT ddpfPixelFormat;
intf_WarnMsg( 3, "vout: DirectXCreateDisplay" );
/* Now create the primary surface. This surface is the displayed surface */ /* Now create the primary surface. This surface is what you actually see
/* The following two steps are important! */ * on your screen */
memset( &ddsd, 0, sizeof( DDSURFACEDESC )); memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC); ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwFlags = DDSD_CAPS; ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
dxresult = IDirectDraw_CreateSurface( p_vout->p_sys->p_ddobject, dxresult = IDirectDraw2_CreateSurface( p_vout->p_sys->p_ddobject,
&ddsd, &ddsd,
&p_vout->p_sys->p_display, NULL ); &p_display, NULL );
if( dxresult != DD_OK ) if( dxresult != DD_OK )
{ {
intf_ErrMsg( "vout error: can't create direct draw primary surface." ); intf_ErrMsg( "vout error: can't create direct draw primary surface." );
...@@ -904,57 +1068,97 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout ) ...@@ -904,57 +1068,97 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
#if 0 dxresult = IDirectDrawSurface_QueryInterface( p_display,
/* Now create a clipper for our window. &IID_IDirectDrawSurface3,
* This clipper prevents us to modify by mistake anything on the screen (LPVOID *)&p_vout->p_sys->p_display );
* (primary surface) which doesn't belong to our window */ if ( dxresult != DD_OK )
dxresult = IDirectDraw_CreateClipper(p_vout->p_sys->p_ddobject, 0,
&p_vout->p_sys->p_clipper, NULL);
if( dxresult != DD_OK )
{ {
intf_ErrMsg( "vout error: can't create clipper." ); intf_ErrMsg( "vout error: can't get IDirectDrawSurface3 interface." );
IDirectDrawSurface_Release( p_vout->p_sys->p_display ); IDirectDrawSurface_Release( p_display );
p_vout->p_sys->p_display = NULL; p_vout->p_sys->p_display = NULL;
return( 1 ); return( 1 );
} }
else
dxresult = IDirectDrawClipper_SetHWnd(p_vout->p_sys->p_clipper, 0,
p_vout->p_sys->hwnd);
if( dxresult != DD_OK )
{ {
intf_ErrMsg( "vout error: can't attach clipper to window." ); /* Release the old interface */
IDirectDrawSurface_Release( p_vout->p_sys->p_display ); IDirectDrawSurface_Release( p_display );
p_vout->p_sys->p_display = NULL;
return( 1 );
} }
dxresult = IDirectDrawSurface_SetClipper(p_vout->p_sys->p_display,
p_vout->p_sys->p_clipper); /* We need to fill in some information for the video output thread.
if( dxresult != DD_OK ) * We do this here because it must be done before the video_output
* thread enters its main loop - and DirectXCreateSurface can be called
* after that ! */
ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
IDirectDrawSurface3_GetPixelFormat( p_vout->p_sys->p_display,
&ddpfPixelFormat );
#ifdef NONAMELESSUNION
p_vout->i_screen_depth = ddpfPixelFormat.u1.dwRGBBitCount;
p_vout->i_bytes_per_pixel = ddpfPixelFormat.u1.dwRGBBitCount/8;
p_vout->i_red_mask = ddpfPixelFormat.u2.dwRBitMask;
p_vout->i_green_mask = ddpfPixelFormat.u3.dwGBitMask;
p_vout->i_blue_mask = ddpfPixelFormat.u4.dwBBitMask;
#else
p_vout->i_screen_depth = ddpfPixelFormat.dwRGBBitCount;
p_vout->i_bytes_per_pixel = ddpfPixelFormat.dwRGBBitCount/8;
p_vout->i_red_mask = ddpfPixelFormat.dwRBitMask;
p_vout->i_green_mask = ddpfPixelFormat.dwGBitMask;
p_vout->i_blue_mask = ddpfPixelFormat.dwBBitMask;
#endif /* NONAMELESSUNION */
/* Create a video surface. This function will try to create an
* YUV overlay first and if it can't it will create a simple RGB surface */
if( DirectXCreateSurface( p_vout ) )
{ {
intf_ErrMsg( "vout error: can't attach clipper to surface." ); intf_ErrMsg( "vout error: can't create a video surface." );
IDirectDrawSurface_Release( p_vout->p_sys->p_display ); IDirectDrawSurface3_Release( p_vout->p_sys->p_display );
p_vout->p_sys->p_display = NULL; p_vout->p_sys->p_display = NULL;
return( 1 ); return( 1 );
} }
#endif
return( 0 );
}
/*****************************************************************************
* DirectXCreateSurface: create an YUV overlay or RGB surface for the video.
*****************************************************************************
* The best method of display is with an YUV overlay because the YUV->RGB
* conversion is done in hardware, so we'll try to create this surface first.
* If we fail, we'll try to create a plain RGB surface.
* ( Maybe we could also try an RGB overlay surface, which could have hardware
* scaling and which would also be faster in window mode because you don't
* need to do any blitting to the main display...)
*****************************************************************************/
static int DirectXCreateSurface( vout_thread_t *p_vout )
{
HRESULT dxresult;
DDSURFACEDESC ddsd;
LPDIRECTDRAWSURFACE p_surface;
DDCAPS ddcaps;
intf_WarnMsg( 3, "vout: DirectXCreateSurface" );
/* Disable display */
p_vout->p_sys->b_display_enabled = 0;
#if 1
/* Probe the capabilities of the hardware */ /* Probe the capabilities of the hardware */
/* This is just an indication of whever or not we'll support overlay, /* This is just an indication of whether or not we'll support overlay,
* but with this test we don't know if we support YUV overlay */ * but with this test we don't know if we support YUV overlay */
memset( &ddcaps, 0, sizeof( DDCAPS )); memset( &ddcaps, 0, sizeof( DDCAPS ));
ddcaps.dwSize = sizeof(DDCAPS); ddcaps.dwSize = sizeof(DDCAPS);
dxresult = IDirectDraw_GetCaps( p_vout->p_sys->p_ddobject, dxresult = IDirectDraw2_GetCaps( p_vout->p_sys->p_ddobject,
&ddcaps, NULL ); &ddcaps, NULL );
if(dxresult != DD_OK ) if(dxresult != DD_OK )
{ {
intf_ErrMsg( "vout error: can't get caps." ); intf_WarnMsg( 3,"vout error: can't get caps." );
bHasOverlay = FALSE;
bHasColorKey = FALSE;
bCanStretch = FALSE;
} }
else else
{ {
BOOL bHasOverlay, bHasColorKey, bCanStretch;
/* Determine if the hardware supports overlay surfaces */ /* Determine if the hardware supports overlay surfaces */
bHasOverlay = ((ddcaps.dwCaps & DDCAPS_OVERLAY) == bHasOverlay = ((ddcaps.dwCaps & DDCAPS_OVERLAY) ==
DDCAPS_OVERLAY) ? TRUE : FALSE; DDCAPS_OVERLAY) ? TRUE : FALSE;
...@@ -964,59 +1168,158 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout ) ...@@ -964,59 +1168,158 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout )
/* Determine if the hardware supports scaling of the overlay surface */ /* Determine if the hardware supports scaling of the overlay surface */
bCanStretch = ((ddcaps.dwCaps & DDCAPS_OVERLAYSTRETCH) == bCanStretch = ((ddcaps.dwCaps & DDCAPS_OVERLAYSTRETCH) ==
DDCAPS_OVERLAYSTRETCH) ? TRUE : FALSE; DDCAPS_OVERLAYSTRETCH) ? TRUE : FALSE;
intf_WarnMsg( 3, "vout: WinDX Caps: overlay=%i colorkey=%i stretch=%i", intf_WarnMsg( 3, "vout: Dx Caps: overlay=%i colorkey=%i stretch=%i",
bHasOverlay, bHasColorKey, bCanStretch ); bHasOverlay, bHasColorKey, bCanStretch );
if( !bHasOverlay ) p_vout->b_need_render = 1;
} }
#endif
p_vout->p_sys->p_overlay = NULL; /* Create the video surface */
if( bHasOverlay && bHasColorKey && bCanStretch ) if( !p_vout->b_need_render )
{ {
if( !WinDXCreateYUVOverlay( p_vout ) ) /* Now try to create the YUV overlay surface.
* This overlay will be displayed on top of the primary surface.
* A color key is used to determine whether or not the overlay will be
* displayed, ie the overlay will be displayed in place of the primary
* surface wherever the primary surface will have this color.
* The video window has been created with a background of this color so
* the overlay will be only displayed on top of this window */
memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
ddsd.ddpfPixelFormat.dwFourCC = mmioFOURCC('Y','V','1','2');
#ifdef NONAMELESSUNION
ddsd.ddpfPixelFormat.u1.dwYUVBitCount = 16;
#else
ddsd.ddpfPixelFormat.dwYUVBitCount = 16;
#endif
ddsd.dwFlags = DDSD_CAPS |
DDSD_HEIGHT |
DDSD_WIDTH |
DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY;
ddsd.dwHeight = p_vout->p_sys->i_image_height;
ddsd.dwWidth = p_vout->p_sys->i_image_width;
dxresult = IDirectDraw2_CreateSurface( p_vout->p_sys->p_ddobject,
&ddsd, &p_surface, NULL );
if( dxresult == DD_OK )
{
intf_WarnMsg( 3,"vout: DirectX YUV overlay created successfully" );
}
else
{ {
/* Overlay created successfully */ intf_ErrMsg( "vout error: can't create YUV overlay surface." );
p_vout->b_need_render = 0; p_vout->b_need_render = 1;
} }
} }
/* Now do some initialisation for video_output */
if( p_vout->b_need_render ) if( p_vout->b_need_render )
{ {
/* if we want a valid pointer to the surface memory, we must lock /* Now try to create a plain RGB surface. */
* the surface */
memset( &ddsd, 0, sizeof( DDSURFACEDESC )); memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC); ddsd.dwSize = sizeof(DDSURFACEDESC);
dxresult = IDirectDrawSurface_Lock(p_vout->p_sys->p_display, ddsd.dwFlags = DDSD_HEIGHT |
NULL, &ddsd, DDSD_WIDTH |
DDLOCK_NOSYSLOCK, NULL); DDSD_CAPS;
if ( dxresult == DDERR_SURFACELOST ) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwHeight = p_vout->p_sys->i_image_height;
ddsd.dwWidth = p_vout->p_sys->i_image_width;
dxresult = IDirectDraw2_CreateSurface( p_vout->p_sys->p_ddobject,
&ddsd, &p_surface, NULL );
if( dxresult == DD_OK )
{ {
/* Your surface can be lost so be sure intf_WarnMsg( 3,"vout: DirectX RGB surface created successfully" );
* to check this and restore it if needed */
dxresult = IDirectDrawSurface_Restore( p_vout->p_sys->p_display );
dxresult = IDirectDrawSurface_Lock( p_vout->p_sys->p_display,
NULL, &ddsd, DDLOCK_NOSYSLOCK
| DDLOCK_WAIT, NULL);
} }
if( dxresult != DD_OK ) else
{ {
intf_WarnMsg( 3, "vout: WinDX could not lock the surface" ); intf_ErrMsg( "vout error: can't create RGB surface." );
p_vout->p_sys->p_surface = NULL;
return( 1 ); return( 1 );
} }
}
/* Now that the surface is created, try to get a newer DirectX interface */
dxresult = IDirectDrawSurface_QueryInterface( p_surface,
&IID_IDirectDrawSurface3,
(LPVOID *)&p_vout->p_sys->p_surface );
if ( dxresult != DD_OK )
{
intf_ErrMsg( "vout error: can't get IDirectDrawSurface3 interface." );
IDirectDrawSurface_Release( p_surface );
p_vout->p_sys->p_surface = NULL;
return( 1 );
}
else
{
/* Release the old interface */
IDirectDrawSurface_Release( p_surface );
}
if( !p_vout->b_need_render )
{
/* Hide the overlay for now */
IDirectDrawSurface3_UpdateOverlay(p_vout->p_sys->p_surface,
NULL,
p_vout->p_sys->p_display,
NULL,
DDOVER_HIDE,
NULL);
}
else
{
DirectXCreateClipper( p_vout );
}
/* Set the pointer to the surface memory */
p_vout->p_sys->p_windx_buf[ 0 ] = ddsd.lpSurface;
/* back buffer, none for now */
p_vout->p_sys->p_windx_buf[ 1 ] = ddsd.lpSurface;
/* From now on, do some initialisation for video_output */
/* Set thread information */ /* if we want a valid pointer to the surface memory, we must lock
p_vout->i_width = ddsd.dwWidth; * the surface */
p_vout->i_height = ddsd.dwHeight;
memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
dxresult = IDirectDrawSurface3_Lock( p_vout->p_sys->p_surface, NULL, &ddsd,
DDLOCK_NOSYSLOCK | DDLOCK_WAIT, NULL);
if ( dxresult == DDERR_SURFACELOST )
{
/* Your surface can be lost so be sure
* to check this and restore it if needed */
dxresult = IDirectDrawSurface3_Restore( p_vout->p_sys->p_surface );
dxresult = IDirectDrawSurface3_Lock( p_vout->p_sys->p_surface,
NULL, &ddsd, DDLOCK_NOSYSLOCK
| DDLOCK_WAIT, NULL);
}
if( dxresult != DD_OK )
{
intf_ErrMsg( "vout: DirectXCreateDisplay could not lock the surface" );
return( 1 );
}
/* Set the pointer to the surface memory */
p_vout->p_sys->p_directx_buf[ 0 ] = ddsd.lpSurface;
/* back buffer, none for now */
p_vout->p_sys->p_directx_buf[ 1 ] = ddsd.lpSurface;
/* Set thread information */
p_vout->i_width = ddsd.dwWidth;
p_vout->i_height = ddsd.dwHeight;
#ifdef NONAMELESSUNION #ifdef NONAMELESSUNION
p_vout->i_bytes_per_line = ddsd.u1.lPitch; p_vout->i_bytes_per_line = ddsd.u1.lPitch;
#else
p_vout->i_bytes_per_line = ddsd.lPitch;
#endif /* NONAMELESSUNION */
if( p_vout->b_need_render )
{
/* For an RGB surface we need to fill in some more info */
#ifdef NONAMELESSUNION
p_vout->i_screen_depth = ddsd.ddpfPixelFormat.u1.dwRGBBitCount; p_vout->i_screen_depth = ddsd.ddpfPixelFormat.u1.dwRGBBitCount;
p_vout->i_bytes_per_pixel = ddsd.ddpfPixelFormat.u1.dwRGBBitCount/8; p_vout->i_bytes_per_pixel = ddsd.ddpfPixelFormat.u1.dwRGBBitCount/8;
...@@ -1024,8 +1327,6 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout ) ...@@ -1024,8 +1327,6 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout )
p_vout->i_green_mask = ddsd.ddpfPixelFormat.u3.dwGBitMask; p_vout->i_green_mask = ddsd.ddpfPixelFormat.u3.dwGBitMask;
p_vout->i_blue_mask = ddsd.ddpfPixelFormat.u4.dwBBitMask; p_vout->i_blue_mask = ddsd.ddpfPixelFormat.u4.dwBBitMask;
#else #else
p_vout->i_bytes_per_line = ddsd.lPitch;
p_vout->i_screen_depth = ddsd.ddpfPixelFormat.dwRGBBitCount; p_vout->i_screen_depth = ddsd.ddpfPixelFormat.dwRGBBitCount;
p_vout->i_bytes_per_pixel = ddsd.ddpfPixelFormat.dwRGBBitCount/8; p_vout->i_bytes_per_pixel = ddsd.ddpfPixelFormat.dwRGBBitCount/8;
...@@ -1034,144 +1335,95 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout ) ...@@ -1034,144 +1335,95 @@ static int WinDXCreateDisplay( vout_thread_t *p_vout )
p_vout->i_blue_mask = ddsd.ddpfPixelFormat.dwBBitMask; p_vout->i_blue_mask = ddsd.ddpfPixelFormat.dwBBitMask;
#endif /* NONAMELESSUNION */ #endif /* NONAMELESSUNION */
/* Unlock the Surface */
dxresult = IDirectDrawSurface_Unlock(p_vout->p_sys->p_display,
ddsd.lpSurface );
/* FIXME: palette in 8bpp ?? */
/* Set and initialize buffers */
p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_windx_buf[ 0 ],
p_vout->p_sys->p_windx_buf[ 1 ] );
} }
else
{
/* Lock the surface */
memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
dxresult = IDirectDrawSurface_Lock(p_vout->p_sys->p_overlay,
NULL, &ddsd, DDLOCK_NOSYSLOCK, NULL);
if ( dxresult == DDERR_SURFACELOST )
{
/* Your surface can be lost (thanks to windows) so be sure
* to check this every time you want to do something with
* it */
dxresult = IDirectDrawSurface_Restore(
p_vout->p_sys->p_overlay );
dxresult = IDirectDrawSurface_Lock( p_vout->p_sys->p_overlay
, NULL, &ddsd,DDLOCK_NOSYSLOCK| DDLOCK_WAIT, NULL);
}
if( dxresult != DD_OK )
{
intf_WarnMsg( 3, "vout: WinDX could not lock the surface" );
return( 1 );
}
p_vout->p_sys->p_windx_buf[ 0 ] = ddsd.lpSurface; /* Unlock the Surface */
p_vout->p_sys->p_windx_buf[ 1 ] = ddsd.lpSurface; dxresult = IDirectDrawSurface3_Unlock(p_vout->p_sys->p_surface,
ddsd.lpSurface );
/* Set thread information */ /* Set and initialize buffers */
p_vout->i_width = ddsd.dwWidth; p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_directx_buf[ 0 ],
p_vout->i_height = ddsd.dwHeight; p_vout->p_sys->p_directx_buf[ 1 ] );
#ifdef NONAMELESSUNION
p_vout->i_bytes_per_line = ddsd.u1.lPitch;
#else
p_vout->i_bytes_per_line = ddsd.lPitch;
#endif /* NONAMELESSUNION */
/* Unlock the Surface */
dxresult = IDirectDrawSurface_Unlock(p_vout->p_sys->p_overlay,
ddsd.lpSurface );
p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_windx_buf[ 0 ], return ( 0 );
p_vout->p_sys->p_windx_buf[ 1 ] );
}
return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* WinDXCreateYUVOveraly: create an YUV overlay surface for the video. * DirectXCreateClipper: Create a clipper that will be used when blitting the
* RGB surface to the main display.
***************************************************************************** *****************************************************************************
* The best method of display is with an YUV overlay because the YUV->RGB * This clipper prevents us to modify by mistake anything on the screen
* conversion is done in hardware. * which doesn't belong to our window. For example when a part of our video
* This function will try to create an YUV overlay. * window is hidden by another window.
*****************************************************************************/ *****************************************************************************/
static int WinDXCreateYUVOverlay( vout_thread_t *p_vout ) static int DirectXCreateClipper( vout_thread_t *p_vout )
{ {
HRESULT dxresult; HRESULT dxresult;
DDSURFACEDESC ddsd;
/* Now create the overlay surface. This overlay will be displayed on intf_WarnMsg( 3, "vout: DirectXCreateClipper" );
* top of the primary surface.
* A color key is used to determine whether or not the overlay will be
* displayed, ie the overlay will be displayed in place of the primary
* surface wherever the primary surface will have this color.
* The video window has been created with a background of this color so
* the overlay will be only displayed on top of this window */
memset( &ddsd, 0, sizeof( DDSURFACEDESC )); /* Create the clipper */
ddsd.dwSize = sizeof(DDSURFACEDESC); dxresult = IDirectDraw2_CreateClipper( p_vout->p_sys->p_ddobject, 0,
ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); &p_vout->p_sys->p_clipper, NULL );
ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
ddsd.ddpfPixelFormat.dwFourCC = mmioFOURCC('Y','V','1','2');
#ifdef NONAMELESSUNION
ddsd.ddpfPixelFormat.u1.dwYUVBitCount = 16;
#else
ddsd.ddpfPixelFormat.dwYUVBitCount = 16;
#endif
ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwFlags = DDSD_CAPS |
DDSD_HEIGHT |
DDSD_WIDTH |
DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY;
ddsd.dwHeight = p_vout->p_sys->i_image_height;
ddsd.dwWidth = p_vout->p_sys->i_image_width;
dxresult = IDirectDraw_CreateSurface( p_vout->p_sys->p_ddobject,
&ddsd,
&p_vout->p_sys->p_overlay, NULL );
if( dxresult != DD_OK ) if( dxresult != DD_OK )
{ {
intf_ErrMsg( "vout error: can't create overlay surface." ); intf_WarnMsg( 3, "vout: DirectXCreateClipper can't create clipper." );
p_vout->p_sys->p_overlay = NULL; IDirectDrawSurface_Release( p_vout->p_sys->p_clipper );
p_vout->p_sys->p_clipper = NULL;
return( 1 );
} }
else
/* associate the clipper to the window */
dxresult = IDirectDrawClipper_SetHWnd(p_vout->p_sys->p_clipper, 0,
p_vout->p_sys->hwnd);
if( dxresult != DD_OK )
{ {
intf_WarnMsg( 3, "vout: WinDX YUV overlay created successfully" ); intf_WarnMsg( 3,
"vout: DirectXCreateClipper can't attach clipper to window." );
IDirectDrawSurface_Release( p_vout->p_sys->p_clipper );
p_vout->p_sys->p_clipper = NULL;
return( 1 );
} }
/* Hide the overlay for now */
IDirectDrawSurface_UpdateOverlay(p_vout->p_sys->p_overlay, /* associate the clipper with the surface */
NULL, dxresult = IDirectDrawSurface_SetClipper(p_vout->p_sys->p_display,
p_vout->p_sys->p_display, p_vout->p_sys->p_clipper);
NULL, if( dxresult != DD_OK )
DDOVER_HIDE, {
NULL); intf_WarnMsg( 3,
"vout: DirectXCreateClipper can't attach clipper to surface." );
return ( 0 ); IDirectDrawSurface_Release( p_vout->p_sys->p_clipper );
p_vout->p_sys->p_clipper = NULL;
return( 1 );
}
return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* WinDXUpdateOverlay: Move or resize overlay surface on video display. * DirectXUpdateOverlay: Move or resize overlay surface on video display.
***************************************************************************** *****************************************************************************
* This function is used to move or resize an overlay surface on the screen. * This function is used to move or resize an overlay surface on the screen.
* Ususally the overlay is moved by the user and thus, by a move or resize * Ususally the overlay is moved by the user and thus, by a move or resize
* event (in vout_Manage). * event (in vout_Manage).
*****************************************************************************/ *****************************************************************************/
static int WinDXUpdateOverlay( vout_thread_t *p_vout ) static int DirectXUpdateOverlay( vout_thread_t *p_vout )
{ {
DDOVERLAYFX ddofx; DDOVERLAYFX ddofx;
RECT rect_window, rect_image; RECT rect_window, rect_window_backup, rect_image;
POINT point_window; POINT point_window;
DWORD dwFlags; DWORD dwFlags;
HRESULT dxresult; HRESULT dxresult;
DWORD dw_colorkey; DWORD dw_colorkey;
DDPIXELFORMAT pixel_format; DDPIXELFORMAT pixel_format;
DDSURFACEDESC ddsd;
if( p_vout->p_sys->p_overlay == NULL || p_vout->b_need_render) if( p_vout->p_sys->p_surface == NULL || p_vout->b_need_render )
{ {
intf_WarnMsg( 3, "vout: WinDX no overlay !!" ); intf_WarnMsg( 3, "vout: DirectXUpdateOverlay no overlay !!" );
return( 0 ); return( 0 );
} }
...@@ -1292,16 +1544,65 @@ static int WinDXUpdateOverlay( vout_thread_t *p_vout ) ...@@ -1292,16 +1544,65 @@ static int WinDXUpdateOverlay( vout_thread_t *p_vout )
/* It seems we can't feed the UpdateOverlay directdraw function with /* It seems we can't feed the UpdateOverlay directdraw function with
* negative values so we have to clip the computed rectangles */ * negative values so we have to clip the computed rectangles */
/* FIXME */ memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH;
IDirectDraw2_GetDisplayMode( p_vout->p_sys->p_ddobject, &ddsd );
rect_window_backup = rect_window;
/* Clip the destination window */
rect_window.left = (rect_window.left < 0) ? 0 : rect_window.left;
rect_window.right = (rect_window.right < 0) ? 0 : rect_window.right;
rect_window.top = (rect_window.top < 0) ? 0 : rect_window.top;
rect_window.bottom = (rect_window.bottom < 0) ? 0 : rect_window.bottom;
rect_window.left = (rect_window.left > ddsd.dwWidth) ? ddsd.dwWidth
: rect_window.left;
rect_window.right = (rect_window.right > ddsd.dwWidth) ? ddsd.dwWidth
: rect_window.right;
rect_window.top = (rect_window.top > ddsd.dwHeight) ? ddsd.dwHeight
: rect_window.top;
rect_window.bottom = (rect_window.bottom > ddsd.dwHeight) ? ddsd.dwHeight
: rect_window.bottom;
intf_WarnMsg( 3, "vout: DirectXUpdateOverlay window coords: %i,%i,%i,%i",
rect_window.left, rect_window.top,
rect_window.right, rect_window.bottom);
/* Clip the source image */
rect_image.left = ( rect_window.left == rect_window_backup.left ) ? 0
: labs(rect_window_backup.left - rect_window.left) *
p_vout->p_rendered_pic->i_width /
(rect_window_backup.right - rect_window_backup.left);
rect_image.right = ( rect_window.right == rect_window_backup.right ) ?
p_vout->p_rendered_pic->i_width
: p_vout->p_rendered_pic->i_width -
labs(rect_window_backup.right - rect_window.right) *
p_vout->p_rendered_pic->i_width /
(rect_window_backup.right - rect_window_backup.left);
rect_image.top = ( rect_window.top == rect_window_backup.top ) ? 0
: labs(rect_window_backup.top - rect_window.top) *
p_vout->p_rendered_pic->i_height /
(rect_window_backup.bottom - rect_window_backup.top);
rect_image.bottom = ( rect_window.bottom == rect_window_backup.bottom ) ?
p_vout->p_rendered_pic->i_height
: p_vout->p_rendered_pic->i_height -
labs(rect_window_backup.bottom - rect_window.bottom) *
p_vout->p_rendered_pic->i_height /
(rect_window_backup.bottom - rect_window_backup.top);
intf_WarnMsg( 3, "vout: DirectXUpdateOverlay image coords: %i,%i,%i,%i",
rect_image.left, rect_image.top,
rect_image.right, rect_image.bottom);
/* compute the colorkey pixel value from the RGB value we've got */ /* compute the colorkey pixel value from the RGB value we've got */
memset( &pixel_format, 0, sizeof( DDPIXELFORMAT )); memset( &pixel_format, 0, sizeof( DDPIXELFORMAT ));
pixel_format.dwSize = sizeof( DDPIXELFORMAT ); pixel_format.dwSize = sizeof( DDPIXELFORMAT );
dxresult = IDirectDrawSurface_GetPixelFormat( p_vout->p_sys->p_display, dxresult = IDirectDrawSurface3_GetPixelFormat( p_vout->p_sys->p_display,
&pixel_format ); &pixel_format );
if( dxresult != DD_OK ) if( dxresult != DD_OK )
intf_WarnMsg( 3, "vout: WinDX GetPixelFormat failed !!" ); intf_WarnMsg( 3, "vout: DirectXUpdateOverlay GetPixelFormat failed" );
dw_colorkey = (DWORD)p_vout->p_sys->i_colorkey; dw_colorkey = (DWORD)p_vout->p_sys->i_colorkey;
#ifdef NONAMELESSUNION #ifdef NONAMELESSUNION
dw_colorkey = (DWORD)((( dw_colorkey * pixel_format.u2.dwRBitMask) / 255) dw_colorkey = (DWORD)((( dw_colorkey * pixel_format.u2.dwRBitMask) / 255)
...@@ -1319,34 +1620,35 @@ static int WinDXUpdateOverlay( vout_thread_t *p_vout ) ...@@ -1319,34 +1620,35 @@ static int WinDXUpdateOverlay( vout_thread_t *p_vout )
dwFlags = DDOVER_KEYDESTOVERRIDE | DDOVER_SHOW; dwFlags = DDOVER_KEYDESTOVERRIDE | DDOVER_SHOW;
dxresult = IDirectDrawSurface_UpdateOverlay(p_vout->p_sys->p_overlay, dxresult = IDirectDrawSurface3_UpdateOverlay(p_vout->p_sys->p_surface,
NULL, /*&rect_image,*/ &rect_image,
p_vout->p_sys->p_display, p_vout->p_sys->p_display,
&rect_window, &rect_window,
dwFlags, dwFlags,
&ddofx); &ddofx);
if(dxresult != DD_OK) if(dxresult != DD_OK)
{ {
intf_WarnMsg( 3, "vout: WinDX can't move or resize overlay" ); intf_WarnMsg( 3,
"vout: DirectXUpdateOverlay can't move or resize overlay" );
} }
return ( 0 ); return ( 0 );
} }
/***************************************************************************** /*****************************************************************************
* WinDXCloseWindow: close the window created by WinDXCreateWindow * DirectXCloseWindow: close the window created by DirectXCreateWindow
***************************************************************************** *****************************************************************************
* This function returns all resources allocated by WinDXCreateWindow. * This function returns all resources allocated by DirectXCreateWindow.
*****************************************************************************/ *****************************************************************************/
static void WinDXCloseWindow( vout_thread_t *p_vout ) static void DirectXCloseWindow( vout_thread_t *p_vout )
{ {
HINSTANCE hInstance; HINSTANCE hInstance;
intf_WarnMsg( 3, "vout: WinDXCloseWindow" ); intf_WarnMsg( 3, "vout: DirectXCloseWindow" );
if( p_vout->p_sys->hwnd != INVALID_HANDLE_VALUE ) if( p_vout->p_sys->hwnd != NULL )
{ {
DestroyWindow( p_vout->p_sys->hwnd); DestroyWindow( p_vout->p_sys->hwnd);
p_vout->p_sys->hwnd = INVALID_HANDLE_VALUE; p_vout->p_sys->hwnd = NULL;
} }
hInstance = GetModuleHandle(NULL); hInstance = GetModuleHandle(NULL);
...@@ -1354,74 +1656,77 @@ static void WinDXCloseWindow( vout_thread_t *p_vout ) ...@@ -1354,74 +1656,77 @@ static void WinDXCloseWindow( vout_thread_t *p_vout )
hInstance ); /* handle to application instance */ hInstance ); /* handle to application instance */
/* free window background brush */ /* free window background brush */
if( p_vout->p_sys->hwnd != INVALID_HANDLE_VALUE ) if( p_vout->p_sys->hwnd != NULL )
{ {
DeleteObject( p_vout->p_sys->hbrush ); DeleteObject( p_vout->p_sys->hbrush );
p_vout->p_sys->hbrush = INVALID_HANDLE_VALUE; p_vout->p_sys->hbrush = NULL;
} }
} }
/***************************************************************************** /*****************************************************************************
* WinDXCloseDDraw: Release the DDraw object allocated by WinDXInitDDraw * DirectXCloseDDraw: Release the DDraw object allocated by DirectXInitDDraw
***************************************************************************** *****************************************************************************
* This function returns all resources allocated by WinDXInitDDraw. * This function returns all resources allocated by DirectXInitDDraw.
*****************************************************************************/ *****************************************************************************/
static void WinDXCloseDDraw( vout_thread_t *p_vout ) static void DirectXCloseDDraw( vout_thread_t *p_vout )
{ {
intf_WarnMsg(3, "vout: WinDXCloseDDraw" ); intf_WarnMsg(3, "vout: DirectXCloseDDraw" );
if( p_vout->p_sys->p_ddobject != NULL ) if( p_vout->p_sys->p_ddobject != NULL )
{ {
IDirectDraw_Release(p_vout->p_sys->p_ddobject); IDirectDraw2_Release(p_vout->p_sys->p_ddobject);
p_vout->p_sys->p_ddobject = NULL; p_vout->p_sys->p_ddobject = NULL;
} }
if( p_vout->p_sys->hddraw_dll != NULL )
{
FreeLibrary( p_vout->p_sys->hddraw_dll );
p_vout->p_sys->hddraw_dll = NULL;
}
} }
/***************************************************************************** /*****************************************************************************
* WinDXCloseDisplay: close and reset DirectX device * DirectXCloseDisplay: close and reset the DirectX display device
***************************************************************************** *****************************************************************************
* This function returns all resources allocated by WinDXCreateDisplay and * This function returns all resources allocated by DirectXCreateDisplay.
* restore the original state of the device.
*****************************************************************************/ *****************************************************************************/
static void WinDXCloseDisplay( vout_thread_t *p_vout ) static void DirectXCloseDisplay( vout_thread_t *p_vout )
{ {
intf_WarnMsg( 3, "vout: WinDXCloseDisplay" ); intf_WarnMsg( 3, "vout: DirectXCloseDisplay" );
if( p_vout->p_sys->p_display != NULL ) if( p_vout->p_sys->p_display != NULL )
{ {
if( p_vout->p_sys->p_overlay != NULL ) DirectXCloseSurface( p_vout );
{
intf_WarnMsg( 3, "vout: WinDXCloseDisplay overlay" );
IDirectDraw_Release( p_vout->p_sys->p_overlay );
p_vout->p_sys->p_overlay = NULL;
}
if( p_vout->p_sys->p_clipper != NULL ) intf_WarnMsg( 3, "vout: DirectXCloseDisplay display" );
{ IDirectDraw2_Release( p_vout->p_sys->p_display );
intf_WarnMsg( 3, "vout: WinDXCloseDisplay clipper" );
IDirectDraw_Release( p_vout->p_sys->p_clipper );
p_vout->p_sys->p_clipper = NULL;
}
intf_WarnMsg( 3, "vout: WinDXCloseDisplay display" );
IDirectDraw_Release( p_vout->p_sys->p_display );
p_vout->p_sys->p_display = NULL; p_vout->p_sys->p_display = NULL;
} }
} }
/***************************************************************************** /*****************************************************************************
* WinDXCloseYUVOverlay: close the overlay surface * DirectXCloseSurface: close the YUV overlay or RGB surface.
***************************************************************************** *****************************************************************************
* This function returns all resources allocated by the overlay surface. * This function returns all resources allocated by the surface.
* We also call this function when the decoded picture change its dimensions * We also call this function when the decoded picture change its dimensions
* (in that case we close the overlay surface and reopen another with the * (in that case we close the overlay surface and reopen another with the
* right dimensions). * right dimensions).
*****************************************************************************/ *****************************************************************************/
static void WinDXCloseYUVOverlay( vout_thread_t *p_vout ) static void DirectXCloseSurface( vout_thread_t *p_vout )
{ {
intf_WarnMsg( 3, "vout: WinDXCloseYUVOverlay" ); intf_WarnMsg( 3, "vout: DirectXCloseSurface" );
if( p_vout->p_sys->p_overlay != NULL ) if( p_vout->p_sys->p_surface != NULL )
{
intf_WarnMsg( 3, "vout: DirectXCloseSurface surface" );
IDirectDraw2_Release( p_vout->p_sys->p_surface );
p_vout->p_sys->p_surface = NULL;
}
if( p_vout->p_sys->p_clipper != NULL )
{ {
IDirectDraw_Release( p_vout->p_sys->p_overlay ); intf_WarnMsg( 3, "vout: DirectXCloseSurface clipper" );
p_vout->p_sys->p_overlay = NULL; IDirectDraw2_Release( p_vout->p_sys->p_clipper );
p_vout->p_sys->p_clipper = NULL;
} }
/* Disable any display */
p_vout->p_sys->b_display_enabled = 0; p_vout->p_sys->b_display_enabled = 0;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_dummy.c : dummy audio output plugin * aout_dummy.c : dummy audio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: aout_dummy.c,v 1.12 2001/05/31 01:37:08 sam Exp $ * $Id: aout_dummy.c,v 1.13 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
*****************************************************************************/ *****************************************************************************/
typedef struct aout_sys_s typedef struct aout_sys_s
{ {
#if defined( _MSC_VER ) /* Prevent malloc(0) */
int i_dummy; int i_dummy;
#endif
} aout_sys_t; } aout_sys_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_dummy.c: dummy interface plugin * intf_dummy.c: dummy interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: intf_dummy.c,v 1.9 2001/05/31 01:37:08 sam Exp $ * $Id: intf_dummy.c,v 1.10 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
*****************************************************************************/ *****************************************************************************/
typedef struct intf_sys_s typedef struct intf_sys_s
{ {
#if defined( _MSC_VER ) /* Prevent malloc(0) */
int i_dummy; int i_dummy;
#endif
} intf_sys_t; } intf_sys_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -30,12 +30,21 @@ $(BUILTIN_DVD): BUILTIN_%.o: %.c ...@@ -30,12 +30,21 @@ $(BUILTIN_DVD): BUILTIN_%.o: %.c
# Real targets # Real targets
# #
ifeq (1,$(LOCAL_LIBDVDCSS))
../../lib/dvd.so: libdvdcss $(PLUGIN_DVD) ../../lib/dvd.so: libdvdcss $(PLUGIN_DVD)
$(CC) $(PCFLAGS) -o $@ $(PLUGIN_DVD) $(PLCFLAGS) $(LIB_DVD) $(CC) $(PCFLAGS) -o $@ $(PLUGIN_DVD) $(PLCFLAGS) ../../lib/libdvdcss.a $(LIB_DVD)
../../lib/dvd.a: libdvdcss $(BUILTIN_DVD) ../../lib/dvd.a: libdvdcss $(BUILTIN_DVD)
ar r $@ $(BUILTIN_DVD) ar r $@ $(BUILTIN_DVD)
$(RANLIB) $@ $(RANLIB) $@
else
../../lib/dvd.so: $(PLUGIN_DVD)
$(CC) $(PCFLAGS) -o $@ $(PLUGIN_DVD) $(PLCFLAGS) $(LIB_DVD)
../../lib/dvd.a: $(BUILTIN_DVD)
ar r $@ $(BUILTIN_DVD)
$(RANLIB) $@
endif
libdvdcss: libdvdcss:
cd ../../ && $(MAKE) libdvdcss cd ../../ && $(MAKE) libdvdcss
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.72 2001/06/13 00:03:08 stef Exp $ * $Id: input_dvd.c,v 1.73 2001/06/14 01:49:44 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -215,7 +215,6 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -215,7 +215,6 @@ static void DVDInit( input_thread_t * p_input )
input_area_t * p_area; input_area_t * p_area;
int i_title; int i_title;
int i_chapter; int i_chapter;
int i_ret;
int i; int i;
p_dvd = malloc( sizeof(thread_dvd_data_t) ); p_dvd = malloc( sizeof(thread_dvd_data_t) );
...@@ -229,29 +228,21 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -229,29 +228,21 @@ static void DVDInit( input_thread_t * p_input )
p_input->p_plugin_data = (void *)p_dvd; p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL; p_input->p_method_data = NULL;
p_dvd->dvdhandle = dvdcss_init( DVDCSS_INIT_QUIET );
if( p_dvd->dvdhandle == NULL )
{
free( p_dvd );
p_input->b_error = 1;
return;
}
/* XXX: put this shit in an access plugin */ /* XXX: put this shit in an access plugin */
if( strlen( p_input->p_source ) > 4 if( strlen( p_input->p_source ) > 4
&& !strncasecmp( p_input->p_source, "dvd:", 4 ) ) && !strncasecmp( p_input->p_source, "dvd:", 4 ) )
{ {
i_ret = dvdcss_open( p_dvd->dvdhandle, p_input->p_source + 4 ); p_dvd->dvdhandle = dvdcss_open( p_input->p_source + 4,
DVDCSS_INIT_QUIET );
} }
else else
{ {
i_ret = dvdcss_open( p_dvd->dvdhandle, p_input->p_source ); p_dvd->dvdhandle = dvdcss_open( p_input->p_source,
DVDCSS_INIT_QUIET );
} }
if( i_ret < 0 ) if( p_dvd->dvdhandle == NULL )
{ {
dvdcss_end( p_dvd->dvdhandle );
free( p_dvd ); free( p_dvd );
p_input->b_error = 1; p_input->b_error = 1;
return; return;
...@@ -276,7 +267,6 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -276,7 +267,6 @@ static void DVDInit( input_thread_t * p_input )
{ {
intf_ErrMsg( "dvd error: allcation error in ifo" ); intf_ErrMsg( "dvd error: allcation error in ifo" );
dvdcss_close( p_dvd->dvdhandle ); dvdcss_close( p_dvd->dvdhandle );
dvdcss_end( p_dvd->dvdhandle );
free( p_dvd ); free( p_dvd );
p_input->b_error = 1; p_input->b_error = 1;
return; return;
...@@ -287,7 +277,6 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -287,7 +277,6 @@ static void DVDInit( input_thread_t * p_input )
intf_ErrMsg( "dvd error: fatal failure in ifo" ); intf_ErrMsg( "dvd error: fatal failure in ifo" );
IfoDestroy( p_dvd->p_ifo ); IfoDestroy( p_dvd->p_ifo );
dvdcss_close( p_dvd->dvdhandle ); dvdcss_close( p_dvd->dvdhandle );
dvdcss_end( p_dvd->dvdhandle );
free( p_dvd ); free( p_dvd );
p_input->b_error = 1; p_input->b_error = 1;
return; return;
...@@ -378,7 +367,6 @@ static void DVDEnd( input_thread_t * p_input ) ...@@ -378,7 +367,6 @@ static void DVDEnd( input_thread_t * p_input )
/* Clean up libdvdcss */ /* Clean up libdvdcss */
dvdcss_close( p_dvd->dvdhandle ); dvdcss_close( p_dvd->dvdhandle );
dvdcss_end( p_dvd->dvdhandle );
free( p_dvd ); free( p_dvd );
...@@ -441,10 +429,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -441,10 +429,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
p_dvd->i_title_id = p_dvd->i_title_id =
vts.title_inf.p_title_start[i_vts_title-1].i_title_id; vts.title_inf.p_title_start[i_vts_title-1].i_title_id;
intf_WarnMsg( 3, "dvd: title %d vts_title %d pgc %d", intf_WarnMsgImm( 3, "dvd: title %d vts_title %d pgc %d",
p_dvd->i_title, p_dvd->i_title, i_vts_title, p_dvd->i_title_id );
i_vts_title,
p_dvd->i_title_id );
/* /*
* CSS cracking has to be done again * CSS cracking has to be done again
...@@ -473,7 +459,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -473,7 +459,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* last video cell */ /* last video cell */
p_dvd->i_cell = 0; p_dvd->i_cell = 0;
intf_FlushMsg();
p_dvd->i_prg_cell = -1 + p_dvd->i_prg_cell = -1 +
vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb; vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_menu.c : functions to handle menu items. * gtk_menu.c : functions to handle menu items.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.9 2001/06/02 01:09:03 sam Exp $ * $Id: gtk_menu.c,v 1.10 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -92,7 +92,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf ); ...@@ -92,7 +92,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf );
* user_data to transmit intf_* and we need to refresh the other menu. * user_data to transmit intf_* and we need to refresh the other menu.
****************************************************************************/ ****************************************************************************/
#define GtkLangToggle( intf, window, menu, type, callback, b_update ) \ #define GTKLANGTOGGLE( intf, window, menu, type, callback, b_update ) \
intf_thread_t * p_intf; \ intf_thread_t * p_intf; \
GtkWidget * p_menu; \ GtkWidget * p_menu; \
es_descriptor_t * p_es; \ es_descriptor_t * p_es; \
...@@ -123,13 +123,13 @@ gint GtkSetupMenus( intf_thread_t * p_intf ); ...@@ -123,13 +123,13 @@ gint GtkSetupMenus( intf_thread_t * p_intf );
void GtkMenubarAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkMenubarAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{ {
GtkLangToggle( "intf_window", p_popup, "popup_audio", AUDIO_ES, GTKLANGTOGGLE( "intf_window", p_popup, "popup_audio", AUDIO_ES,
GtkPopupAudioToggle, b_audio_update ); GtkPopupAudioToggle, b_audio_update );
} }
void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{ {
GtkLangToggle( "intf_popup", p_window, "menubar_audio", AUDIO_ES, GTKLANGTOGGLE( "intf_popup", p_window, "menubar_audio", AUDIO_ES,
GtkMenubarAudioToggle, b_audio_update ); GtkMenubarAudioToggle, b_audio_update );
} }
...@@ -139,17 +139,17 @@ void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) ...@@ -139,17 +139,17 @@ void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
void GtkMenubarSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkMenubarSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{ {
GtkLangToggle( "intf_window", p_popup, "popup_subpictures", SPU_ES, GTKLANGTOGGLE( "intf_window", p_popup, "popup_subpictures", SPU_ES,
GtkPopupSubtitleToggle, b_spu_update ); GtkPopupSubtitleToggle, b_spu_update );
} }
void GtkPopupSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkPopupSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{ {
GtkLangToggle( "intf_popup", p_window, "menubar_subpictures", SPU_ES, GTKLANGTOGGLE( "intf_popup", p_window, "menubar_subpictures", SPU_ES,
GtkMenubarSubtitleToggle, b_spu_update ); GtkMenubarSubtitleToggle, b_spu_update );
} }
#undef GtkLangToggle #undef GTKLANGTOGGLE
/* /*
* Navigation * Navigation
...@@ -259,7 +259,7 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) ...@@ -259,7 +259,7 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
* Angle * Angle
*/ */
#define GtkAngleToggle( intf, window, menu, callback ) \ #define GTKANGLETOGGLE( intf, window, menu, callback ) \
intf_thread_t * p_intf; \ intf_thread_t * p_intf; \
GtkWidget * p_menu; \ GtkWidget * p_menu; \
input_area_t * p_area; \ input_area_t * p_area; \
...@@ -285,17 +285,17 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) ...@@ -285,17 +285,17 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
void GtkMenubarAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkMenubarAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{ {
GtkAngleToggle( "intf_window", p_popup, "popup_angle", GTKANGLETOGGLE( "intf_window", p_popup, "popup_angle",
GtkPopupAngleToggle ); GtkPopupAngleToggle );
} }
void GtkPopupAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkPopupAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{ {
GtkAngleToggle( "intf_popup", p_window, "menubar_angle", GTKANGLETOGGLE( "intf_popup", p_window, "menubar_angle",
GtkMenubarAngleToggle ); GtkMenubarAngleToggle );
} }
#undef GtkAngleToggle #undef GTKANGLETOGGLE
/**************************************************************************** /****************************************************************************
* Functions to generate menus * Functions to generate menus
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_menu.h: prototypes for menu functions * gtk_menu.h: prototypes for menu functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_menu.h,v 1.3 2001/05/19 00:39:30 stef Exp $ * $Id: gtk_menu.h,v 1.4 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr> * Stéphane Borel <stef@via.ecp.fr>
...@@ -26,3 +26,15 @@ struct intf_thread_s; ...@@ -26,3 +26,15 @@ struct intf_thread_s;
gint GtkSetupMenus( struct intf_thread_s * ); gint GtkSetupMenus( struct intf_thread_s * );
/*****************************************************************************
* String sizes
*****************************************************************************/
#define GTK_MENU_LABEL_SIZE 64
/*****************************************************************************
* Convert user_data structures to title and chapter information
*****************************************************************************/
#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gtk.h: private Gtk+ interface description * intf_gtk.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.h,v 1.6 2001/05/23 23:08:20 stef Exp $ * $Id: intf_gtk.h,v 1.7 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -27,18 +27,6 @@ ...@@ -27,18 +27,6 @@
#define DROP_ACCEPT_TEXT_URI_LIST 0 #define DROP_ACCEPT_TEXT_URI_LIST 0
#define DROP_ACCEPT_TEXT_PLAIN 1 #define DROP_ACCEPT_TEXT_PLAIN 1
/*****************************************************************************
* String sizes
*****************************************************************************/
#define GTK_MENU_LABEL_SIZE 64
/*****************************************************************************
* Convert user_data structures to title and chapter information
*****************************************************************************/
#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
/***************************************************************************** /*****************************************************************************
* Useful inline function * Useful inline function
****************************************************************************/ ****************************************************************************/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.120 2001/06/12 18:16:49 stef Exp $ * $Id: input.c,v 1.121 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -145,7 +145,8 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status ) ...@@ -145,7 +145,8 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
p_input->stream.pp_areas = NULL; p_input->stream.pp_areas = NULL;
p_input->stream.p_selected_area = NULL; p_input->stream.p_selected_area = NULL;
p_input->stream.p_new_area = NULL; p_input->stream.p_new_area = NULL;
/* By default there is one areas in a stream */
/* By default there is one area in a stream */
input_AddArea( p_input ); input_AddArea( p_input );
p_input->stream.p_selected_area = p_input->stream.pp_areas[0]; p_input->stream.p_selected_area = p_input->stream.pp_areas[0];
...@@ -163,10 +164,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status ) ...@@ -163,10 +164,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
p_input->pf_network_close = NetworkClose; p_input->pf_network_close = NetworkClose;
#endif #endif
/* Create thread and set locks. */ /* Create thread. */
vlc_mutex_init( &p_input->stream.stream_lock );
vlc_cond_init( &p_input->stream.stream_wait );
vlc_mutex_init( &p_input->stream.control.control_lock );
if( vlc_thread_create( &p_input->thread_id, "input", (void *) RunThread, if( vlc_thread_create( &p_input->thread_id, "input", (void *) RunThread,
(void *) p_input ) ) (void *) p_input ) )
{ {
...@@ -242,6 +240,7 @@ static void RunThread( input_thread_t *p_input ) ...@@ -242,6 +240,7 @@ static void RunThread( input_thread_t *p_input )
p_input->b_error = 1; p_input->b_error = 1;
ErrorThread( p_input ); ErrorThread( p_input );
DestroyThread( p_input ); DestroyThread( p_input );
free( p_input );
return; return;
} }
...@@ -378,6 +377,11 @@ static int InitThread( input_thread_t * p_input ) ...@@ -378,6 +377,11 @@ static int InitThread( input_thread_t * p_input )
p_input->c_packets_trashed = 0; p_input->c_packets_trashed = 0;
#endif #endif
/* Set locks. */
vlc_mutex_init( &p_input->stream.stream_lock );
vlc_cond_init( &p_input->stream.stream_wait );
vlc_mutex_init( &p_input->stream.control.control_lock );
/* Default, might get overwritten */ /* Default, might get overwritten */
p_input->pf_open = p_input->pf_file_open; p_input->pf_open = p_input->pf_file_open;
p_input->pf_close = p_input->pf_file_close; p_input->pf_close = p_input->pf_file_close;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.102 2001/06/12 22:14:44 sam Exp $ * $Id: main.c,v 1.103 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -251,6 +251,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -251,6 +251,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
p_aout_bank = &aout_bank; p_aout_bank = &aout_bank;
p_vout_bank = &vout_bank; p_vout_bank = &vout_bank;
/*
* Initialize threads
*/
#if defined( PTH_INIT_IN_PTH_H )
pth_init( );
#endif
/* /*
* Test if our code is likely to run on this CPU * Test if our code is likely to run on this CPU
*/ */
...@@ -385,12 +392,17 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -385,12 +392,17 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
system_End(); system_End();
#endif #endif
/* /*
* Terminate messages interface and program * Terminate messages interface and program
*/ */
intf_Msg( "intf: program terminated" ); intf_Msg( "intf: program terminated" );
intf_MsgDestroy(); intf_MsgDestroy();
#if defined( PTH_INIT_IN_PTH_H )
pth_kill( );
#endif
return 0; return 0;
} }
...@@ -926,7 +938,9 @@ static void InstructionSignalHandler( int i_signal ) ...@@ -926,7 +938,9 @@ static void InstructionSignalHandler( int i_signal )
i_illegal = 1; i_illegal = 1;
#ifdef HAVE_SIGRELSE
sigrelse( i_signal ); sigrelse( i_signal );
#endif
longjmp( env, 1 ); longjmp( env, 1 );
} }
...@@ -980,7 +994,7 @@ static int CPUCapabilities( void ) ...@@ -980,7 +994,7 @@ static int CPUCapabilities( void )
volatile unsigned int i_eax, i_ebx, i_ecx, i_edx; volatile unsigned int i_eax, i_ebx, i_ecx, i_edx;
volatile boolean_t b_amd; volatile boolean_t b_amd;
signal( SIGILL, InstructionSignalHandler ); signal( SIGILL, InstructionSignalHandler );
/* test for a 486 CPU */ /* test for a 486 CPU */
asm volatile ( "pushfl\n\t" asm volatile ( "pushfl\n\t"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.c : Built-in and plugin modules management functions * modules.c : Built-in and plugin modules management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.34 2001/06/03 12:47:22 sam Exp $ * $Id: modules.c,v 1.35 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com> * Ethan C. Baldridge <BaldridgeE@cadmus.com>
...@@ -515,10 +515,27 @@ static int AllocatePluginModule( char * psz_filename ) ...@@ -515,10 +515,27 @@ static int AllocatePluginModule( char * psz_filename )
|| p_module->psz_version == NULL ) || p_module->psz_version == NULL )
{ {
intf_ErrMsg( "module error: can't duplicate strings" ); intf_ErrMsg( "module error: can't duplicate strings" );
free( p_module->is.plugin.psz_filename );
free( p_module->psz_name ); if( p_module->is.plugin.psz_filename != NULL )
free( p_module->psz_longname ); {
free( p_module->psz_version ); free( p_module->is.plugin.psz_filename );
}
if( p_module->psz_name != NULL )
{
free( p_module->psz_name );
}
if( p_module->psz_longname != NULL )
{
free( p_module->psz_longname );
}
if( p_module->psz_version != NULL )
{
free( p_module->psz_version );
}
free( p_module ); free( p_module );
module_unload( handle ); module_unload( handle );
return( -1 ); return( -1 );
...@@ -619,9 +636,22 @@ static int AllocateBuiltinModule( int ( *pf_init ) ( module_t * ), ...@@ -619,9 +636,22 @@ static int AllocateBuiltinModule( int ( *pf_init ) ( module_t * ),
|| p_module->psz_version == NULL ) || p_module->psz_version == NULL )
{ {
intf_ErrMsg( "module error: can't duplicate strings" ); intf_ErrMsg( "module error: can't duplicate strings" );
free( p_module->psz_name );
free( p_module->psz_longname ); if( p_module->psz_name != NULL )
free( p_module->psz_version ); {
free( p_module->psz_name );
}
if( p_module->psz_longname != NULL )
{
free( p_module->psz_longname );
}
if( p_module->psz_version != NULL )
{
free( p_module->psz_version );
}
free( p_module ); free( p_module );
return( -1 ); return( -1 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules_core.h : Module management functions used by the core application. * modules_core.h : Module management functions used by the core application.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules_core.h,v 1.1 2001/06/02 01:09:03 sam Exp $ * $Id: modules_core.h,v 1.2 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -116,6 +116,7 @@ module_getsymbol( module_handle_t handle, char * psz_function ) ...@@ -116,6 +116,7 @@ module_getsymbol( module_handle_t handle, char * psz_function )
#else #else
return( dlsym( handle, psz_function ) ); return( dlsym( handle, psz_function ) );
#endif #endif
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Functions are prototyped in mtime.h. * Functions are prototyped in mtime.h.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mtime.c,v 1.21 2001/05/31 12:45:39 sam Exp $ * $Id: mtime.c,v 1.22 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
#include <stdio.h> /* sprintf() */ #include <stdio.h> /* sprintf() */
#if defined( PTH_INIT_IN_PTH_H ) /* GNU Pth */
# include <pth.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> /* select() */ # include <unistd.h> /* select() */
#endif #endif
...@@ -198,14 +202,18 @@ void mwait( mtime_t date ) ...@@ -198,14 +202,18 @@ void mwait( mtime_t date )
return; return;
} }
# ifdef HAVE_USLEEP # if defined( PTH_INIT_IN_PTH_H )
pth_usleep( delay );
# elif defined( HAVE_USLEEP )
usleep( delay ); usleep( delay );
# else # else
tv_delay.tv_sec = delay / 1000000; tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000; tv_delay.tv_usec = delay % 1000000;
/* see msleep() about select() errors */ /* see msleep() about select() errors */
select( 0, NULL, NULL, NULL, &tv_delay ); select( 0, NULL, NULL, NULL, &tv_delay );
# endif # endif
#endif #endif
...@@ -224,6 +232,12 @@ void msleep( mtime_t delay ) ...@@ -224,6 +232,12 @@ void msleep( mtime_t delay )
#elif defined( HAVE_USLEEP ) || defined( WIN32 ) #elif defined( HAVE_USLEEP ) || defined( WIN32 )
usleep( delay ); usleep( delay );
#elif defined( PTH_INIT_IN_PTH_H )
struct timeval tv_delay;
tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000;
pth_select( 0, NULL, NULL, NULL, &tv_delay );
#else #else
struct timeval tv_delay; struct timeval tv_delay;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: video_output.c,v 1.131 2001/05/31 03:57:54 sam Exp $ * $Id: video_output.c,v 1.132 2001/06/14 01:49:44 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -979,6 +979,7 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -979,6 +979,7 @@ static void RunThread( vout_thread_t *p_vout)
while( (!p_vout->b_die) && (!p_vout->b_error) ) while( (!p_vout->b_die) && (!p_vout->b_error) )
{ {
/* Initialize loop variables */ /* Initialize loop variables */
p_vout->p_rendered_pic = NULL;
p_pic = NULL; p_pic = NULL;
p_subpic = NULL; p_subpic = NULL;
p_ephemer = NULL; p_ephemer = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment