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
......
This diff is collapsed.
...@@ -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 dnl
AC_ARG_ENABLE(dummy, AC_ARG_ENABLE(pth,
[ --disable-dummy dummy module (default enabled)]) [ --enable-pth Enable GNU Pth support (default disabled)],
if test x$enable_dummy != xno; then [ if test x$enableval = xyes; then
BUILTINS="${BUILTINS} dummy"; fi AC_CHECK_LIB(pth,pth_init)
AC_EGREP_HEADER(pth_init,pth.h,[
dnl AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
dnl null plugin Define if <pth.h> defines pth_init)
dnl THREAD_LIB="-lpth"
AC_ARG_ENABLE(null, fi])
[ --disable-null Null module (default enabled)]) ])
if test x$enable_null != xno; then
BUILTINS="${BUILTINS} null"; 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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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