Commit a264d032 authored by Sam Hocevar's avatar Sam Hocevar

  * Made everything ready for a vlc-0.2.91 / libdvdcss-1.0.0 release.
  * Updated ChangeLog and ChangeLog.libdvdcss.
  * Increased vlcs response message length.
  * Removed the i_flags argument to dvdcss_open. Everything is done through
    environment variables now.
parent b5b61d84
...@@ -6,6 +6,93 @@ HEAD ...@@ -6,6 +6,93 @@ HEAD
* Nothing yet. * Nothing yet.
0.2.91
Mon, 12 Nov 2001 17:14:29 +0100
* Added FAQ.
* New --channelserver switch.
* Documentation updates.
* ipkg script for Familiar Linux 0.5 & bug fix in debian/rules.
* Disabled DirectX audio output for the time being.
* Added Oct's NSIS installer script. It will probably not work for you,
but I need it to build the Win32 auto installer.
* Automatic handling of the Channel Server's response in network mode.
* GetMACAddress takes the interface defined in the environment variable
vlc_iface instead of eth0.
* Fixed bug with MPEG audio in TS streams.
* Fixed compilation (and quite probably runtime) issues under IA64
due to mixed int/void* casts.
* Merged DVD netlist with input netlist to remove duplicated code.
* BSD/OS VCD patch, courtesy of Steven M. Schultz <sms@TO.GD-ES.COM>.
* Win32 network fix.
* imdctsse should now compile and work in plugin and under BeOS.
* Kludge to have less discontinuity after a zero scr in DVD.
* Fixed some win32 64-bit issues.
* Fixed some win32 compile issues.
* Don't use long long, use u64/s64 (int_types.h).
* Move function that translates language codes into country name in src/misc
so that every plugin can use it.
* Changed the name of a function in dvd_udf.c to fit with the forthcoming
libdvdread plugin.
* Corrected à long time bug (around 0.2.81 I think), that created a
corruption in ifo data. This was the reason why some DVDs that worked with
0.2.80 no longer worked with newer version of vlc. They should work again
now.
* New --enable-release config option.
* Removed deprecated code and structures.
* Maybe corrected aspect ratio issue in fullscreen xvideo.
* Fixed support for SPU and LPCM streams over network.
* Added a new drawer to the control window to support Title / Chapter
selection, Subtitle selection, Audiochannel/Language selection,
Angle selection.
* New --volume option (untested, like usual :).
* Reimported Intf_Controller, connected "File/Open/File" to
Intf_Controller::file:Open (OS X).
* The intf is no longer accessed indirectly from vout_Destroy.
* Made it possible to open a File after vlc was started (you can use vlc now
without starting it from the command line) under OS X.
* Cleaned up playlist handling in Intf_Vlc_Wrapper.
* Modified the pf_close kludge in input.c so that we don't segfault when
pf_init fails.
* Changed chapter selection buttons aspect to try and differentiate them
from title selection ones.
* Changes to the BeOS interface to remove unwanted volumes from the Disk
Menu. Readonly filesystems like NTFS were being incorrectly added.
* Do not resample audio output if delta is short enough.
* Fixed a segfault on exit under Windows 2000.
* Enabled http button in gtk/gnome interface.
* Use memalign for aligned data (instead of a greek malloc).
* Some optimizations in imdct (all data are now aligned).
* SSE downmix now works for windows.
* SSE imdct is desactivated for windows (MINGW32 doesn't know how to aligned
data).
* Fixed '-' input.
* New interface for MacOS X, courtesy of Florian G. Pflug.
* BeOS interface changes to include menu for Title and chapter navigation.
* Improved more "BeOS" CD detection.
* VLC FAQ TBU.
* Synced dummy_dvdcss with Stef's changes to libdvdcss.
* configure now compiles the VCD plugin if linux/cdrom.h is present.
* Added VCD input plugin for Linux.
* Fixed ATTR_ALIGN configure test.
* Fixed compilation problems with OpenBSD.
* xvideo.so is now built in by default. Mixing PIC and non-PIC code was not
very nice.
* Fixed compilation errors in src/interface/main.c when the compiler did
not support SSE or 3DNow! inline assembly.
* Qt fix in vlc.spec courtesy of Christopher Johnson <cjohnson@mint.net>.
* Fixed error reporting on an unknown argument parsing.
* Fixed a deadlock in the TS input.
* Resizing the video out window in BeOS now retains the scaling.
* Tidied up the BeOS code to remove interface messages not required.
* Fixed an error in the ts://server[:port][/broadcast] input parsing.
* Minor video parser optimization.
* SDL now displays an error message on 422 streams.
* Chroma 4:2:2 and 4:4:4 support in the decoder.
* Fixed bugs in the C YUV transform with 4:2:2 format.
* Fixed bugs in RPM spec files.
* Fixed a bug in configure where ix86 machines were improperly detected.
0.2.90 0.2.90
Wed, 10 Oct 2001 15:00:29 +0200 Wed, 10 Oct 2001 15:00:29 +0200
......
...@@ -4,6 +4,33 @@ ...@@ -4,6 +4,33 @@
HEAD HEAD
* Nothing yet.
1.0.0
Mon, 12 Nov 2001 17:14:29 +0100
* Removed the i_flags argument to dvdcss_open. Everything is done through
environment variables now.
* Fixed a buffer overflow in CSSAuth().
* libdvdcss port to OpenBSD.
* Fixed NetBSD (and probably OpenBSD) libdvdcss compilation.
* Fixed undefined KEY_SIZE compile bug mentioned by Dave Thorup.
* Fixed CSS ioctl for Darwin/OSX - still might need tweaking of 'dataLength'
fields.
* Added ReadTitleKey ioctl for Darwin/OSX.
* When using title cracking method in libdvdcss, the key is only checked at
title start, not before each chapter.
* Use of an environment variable to choose libdvdcss method.
* New features for libdvdcss: we have three ways now to decode a title key.
* 1) Crack the title key (the method that was here before). The only change
here is that we search the key for the exact chapter we are seeking with
DVDSetArea (in case the key has changed within a title). It is maybe not a
good idea.
* 2) Crack the disc key, which allows us to decode instantly all title keys.
I've used an algorithm from Frank Stevenson ; it eats much memory (64MB),
and takes about 15 s at launch time.
* 3) Decode the disc key with player keys (libcss method). However, you need
licensed player keys at build time for this to work.
* Darwin ioctl, courtesy of ej0. * Darwin ioctl, courtesy of ej0.
* If we see 3000 unencrypted blocks assume that the title is unencrypted. * If we see 3000 unencrypted blocks assume that the title is unencrypted.
* If we have not seen any encrypted block and then discover that the block * If we have not seen any encrypted block and then discover that the block
......
...@@ -300,15 +300,19 @@ snapshot-common: ...@@ -300,15 +300,19 @@ snapshot-common:
-type d -name CVS -o -name '.*' -o -name '*.[o]' | \ -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
while read i ; do rm -Rf $$i ; done while read i ; do rm -Rf $$i ; done
# Copy misc files # Copy misc files
cp vlc.spec AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \ cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
Makefile Makefile.opts.in Makefile.dep Makefile.modules \ Makefile Makefile.opts.in Makefile.dep Makefile.modules \
configure configure.in install-sh config.sub config.guess \ configure configure.in install-sh install-win32 vlc.spec \
config.sub config.guess \
tmp/vlc/ tmp/vlc/
# Copy Debian control files # Copy Debian control files
for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \ for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
debian/*copyright ; do cp $$file tmp/vlc/debian ; done debian/*copyright ; do cp $$file tmp/vlc/debian ; done
for file in control changelog rules ; do \ for file in control changelog rules ; do \
cp debian/$$file tmp/vlc/debian/ ; done cp debian/$$file tmp/vlc/debian/ ; done
# Copy ipkg control files
for file in control rules ; do \
cp ipkg/$$file tmp/vlc/ipkg/ ; done
# Copy fonts and icons # Copy fonts and icons
for file in share/*png share/*xpm share/*psf ; do \ for file in share/*png share/*xpm share/*psf ; do \
cp $$file tmp/vlc/share ; done cp $$file tmp/vlc/share ; done
...@@ -365,7 +369,7 @@ package-win32: ...@@ -365,7 +369,7 @@ package-win32:
README README.libdvdcss FAQ TODO tmp/ README README.libdvdcss FAQ TODO tmp/
for file in gtk-1.3.dll gdk-1.3.dll glib-1.3.dll gmodule-1.3.dll \ for file in gtk-1.3.dll gdk-1.3.dll glib-1.3.dll gmodule-1.3.dll \
gnu-intl.dll SDL.dll README-SDL.txt ; \ gnu-intl.dll SDL.dll README-SDL.txt ; \
do cp ../vlc-win32/$$file tmp/ ; done do cp ../win32-libs/$$file tmp/ ; done
mkdir tmp/share mkdir tmp/share
for file in default8x16.psf default8x9.psf ; \ for file in default8x16.psf default8x9.psf ; \
do cp share/$$file tmp/share/ ; done do cp share/$$file tmp/share/ ; done
...@@ -381,6 +385,7 @@ libdvdcss-snapshot: snapshot-common ...@@ -381,6 +385,7 @@ libdvdcss-snapshot: snapshot-common
rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc
rm -Rf tmp/vlc/extras/GNUgetopt tmp/vlc/extras/MacOSX rm -Rf tmp/vlc/extras/GNUgetopt tmp/vlc/extras/MacOSX
rm -Rf tmp/vlc/debian rm -Rf tmp/vlc/debian
rm -Rf tmp/vlc/ipkg
# Remove useless headers # Remove useless headers
rm -f tmp/vlc/include/* rm -f tmp/vlc/include/*
for file in defs.h.in config.h.in common.h int_types.h ; \ for file in defs.h.in config.h.in common.h int_types.h ; \
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ AC_CANONICAL_SYSTEM ...@@ -7,7 +7,7 @@ AC_CANONICAL_SYSTEM
HAVE_VLC=0 HAVE_VLC=0
if test -r src/interface/main.c; then if test -r src/interface/main.c; then
HAVE_VLC=1 HAVE_VLC=1
VLC_VERSION=0.2.90 VLC_VERSION=0.2.91
AC_SUBST(VLC_VERSION) AC_SUBST(VLC_VERSION)
VLC_CODENAME=Ourumov VLC_CODENAME=Ourumov
AC_SUBST(VLC_CODENAME) AC_SUBST(VLC_CODENAME)
...@@ -16,7 +16,7 @@ fi ...@@ -16,7 +16,7 @@ fi
HAVE_LIBDVDCSS=0 HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then if test -r extras/libdvdcss/libdvdcss.c; then
HAVE_LIBDVDCSS=1 HAVE_LIBDVDCSS=1
LIBDVDCSS_VERSION=0.0.3 LIBDVDCSS_VERSION=1.0.0
AC_SUBST(LIBDVDCSS_VERSION) AC_SUBST(LIBDVDCSS_VERSION)
if test -r extras/libdvdcss/csskeys.h; then if test -r extras/libdvdcss/csskeys.h; then
AC_DEFINE(HAVE_CSSKEYS,1,css decryption with player keys) AC_DEFINE(HAVE_CSSKEYS,1,css decryption with player keys)
...@@ -479,7 +479,6 @@ AC_CHECK_HEADERS(sys/ioctl.h,[ ...@@ -479,7 +479,6 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
fi fi
]) ])
dnl dnl
dnl Check the operating system dnl Check the operating system
dnl dnl
......
vlc (0.2.91-1) unstable; urgency=low
* New upstream release.
* vlc will dlopen() an installed libdvdcss if available, to play
encrypted DVDs (Closes: #89856).
* vlc is now in sync with the official libdvdcss (Closes: #118194).
-- Samuel Hocevar <sam@zoy.org> Mon, 12 Nov 2001 17:14:29 +0100
vlc (0.2.90-2) unstable; urgency=low vlc (0.2.90-2) unstable; urgency=low
* Various upstream bugfixes. * Various upstream bugfixes.
......
...@@ -15,21 +15,21 @@ Description: a free MPEG and DVD player ...@@ -15,21 +15,21 @@ Description: a free MPEG and DVD player
This is vlc, the VideoLAN Client. It plays MPEG and MPEG2 files, This is vlc, the VideoLAN Client. It plays MPEG and MPEG2 files,
DVDs, or MPEG streams from a network source. DVDs, or MPEG streams from a network source.
Package: libdvdcss0.0.3 Package: libdvdcss1
Architecture: any Architecture: any
Depends: ${shlibs:Depends} Depends: ${shlibs:Depends}
Conflicts: libdvdcss0.0.2 Conflicts: libdvdcss0.0.1, libdvdcss0.0.2, libdvdcss0.0.3
Description: a portable abstraction library for DVD decryption Description: a portable abstraction library for DVD decryption
libdvdcss is a portable abstraction library for DVD decryption, it libdvdcss is a portable abstraction library for DVD decryption, it
provides a simple API to access a DVD device as a block device. provides a simple API to access a DVD device as a block device.
. .
This package contains the libdvdcss0 runtime library. This package contains the libdvdcss0 runtime library.
Package: libdvdcss0.0.3-dev Package: libdvdcss1-dev
Architecture: any Architecture: any
Depends: libdvdcss0.0.3 (= ${Source-Version}), libc6-dev Depends: libdvdcss1 (= ${Source-Version}), libc6-dev
Conflicts: libdvdcss0.0.2-dev Conflicts: libdvdcss0.0.1-dev, libdvdcss0.0.2-dev, libdvdcss0.0.3-dev
Description: development files for libdvdcss0 Description: development files for libdvdcss1
libdvdcss is a portable abstraction library for DVD decryption, it libdvdcss is a portable abstraction library for DVD decryption, it
provides a simple API to access a DVD device as a block device. provides a simple API to access a DVD device as a block device.
. .
......
...@@ -16,8 +16,8 @@ export PIXDIR="usr/share/pixmaps" ...@@ -16,8 +16,8 @@ export PIXDIR="usr/share/pixmaps"
export GNOMEDIR="usr/share/gnome/apps/Multimedia" export GNOMEDIR="usr/share/gnome/apps/Multimedia"
# Library options # Library options
version=$(shell grep '^ *LIBDVDCSS_VERSION=' configure.in | cut -f2 -d=) version=$(shell grep '^ *LIBDVDCSS_VERSION=[0-9]' configure.in | head -1 | cut -f2 -d=)
major=$(shell echo $(version) | cut -f1 -d.) major=$(shell echo "$(version)" | cut -f1 -d.)
build: build-stamp build: build-stamp
build-stamp: build-stamp:
...@@ -93,13 +93,13 @@ install: build ...@@ -93,13 +93,13 @@ install: build
# libdvdcss start # libdvdcss start
mv debian/vlc/usr/include/videolan/dvdcss.h \ mv debian/vlc/usr/include/videolan/dvdcss.h \
debian/libdvdcss$(version)-dev/usr/include/videolan debian/libdvdcss$(major)-dev/usr/include/videolan
rmdir debian/vlc/usr/include/videolan rmdir debian/vlc/usr/include/videolan
rmdir debian/vlc/usr/include rmdir debian/vlc/usr/include
mv debian/vlc/usr/lib/*.a debian/libdvdcss$(version)-dev/usr/lib mv debian/vlc/usr/lib/*.a debian/libdvdcss$(major)-dev/usr/lib
mv debian/vlc/usr/lib/*.so debian/libdvdcss$(version)-dev/usr/lib mv debian/vlc/usr/lib/*.so debian/libdvdcss$(major)-dev/usr/lib
mv debian/vlc/usr/lib/*.so.* debian/libdvdcss$(version)/usr/lib mv debian/vlc/usr/lib/*.so.* debian/libdvdcss$(major)/usr/lib
ln -s libdvdcss$(version) debian/libdvdcss$(version)-dev/usr/share/doc/libdvdcss$(version)-dev ln -s libdvdcss$(major) debian/libdvdcss$(major)-dev/usr/share/doc/libdvdcss$(major)-dev
# libdvdcss stop # libdvdcss stop
# Build architecture-independent files here. # Build architecture-independent files here.
......
...@@ -124,6 +124,13 @@ audio channel will also depend on the channel type. ...@@ -124,6 +124,13 @@ audio channel will also depend on the channel type.
.B \-s, \-\-dvdsubtitle [ 0\-31 ] .B \-s, \-\-dvdsubtitle [ 0\-31 ]
Select the subtitle channel, if there is one in the stream. Select the subtitle channel, if there is one in the stream.
.TP .TP
.B \-\-dvdcss-method <method>
Select the CSS decryption scheme when using libdvdcss. Usually to choose
from "disc", "title" or "key", but depends on your libdvdcss version.
.TP
.B \-\-dvdcss-verbose <level>
Select the CSS decryption verbosity level, 0, 1 or 2.
.TP
.B \-\-input <method> .B \-\-input <method>
Choose the input method, "dvd", "ps", "ts" for instance. Choose the input method, "dvd", "ps", "ts" for instance.
.TP .TP
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* css.c: Functions for DVD authentification and unscrambling * css.c: Functions for DVD authentification and unscrambling
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: css.c,v 1.14 2001/11/11 04:51:10 jlj Exp $ * $Id: css.c,v 1.15 2001/11/12 20:16:32 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* Hkan Hjort <d95hjort@dtek.chalmers.se> * Hkan Hjort <d95hjort@dtek.chalmers.se>
...@@ -61,7 +61,7 @@ static int CSSGetASF ( dvdcss_handle dvdcss ); ...@@ -61,7 +61,7 @@ static int CSSGetASF ( dvdcss_handle dvdcss );
static void CSSCryptKey ( int i_key_type, int i_varient, static void CSSCryptKey ( int i_key_type, int i_varient,
u8 const * p_challenge, u8* p_key ); u8 const * p_challenge, u8* p_key );
static void CSSDecryptKey( u8* p_crypted, u8* p_key, u8 ); static void CSSDecryptKey( u8* p_crypted, u8* p_key, u8 );
static int CSSDiscCrack ( u8 * p_disc_key ); static int CSSDiscCrack ( dvdcss_handle dvdcss, u8 * p_disc_key );
static int CSSTitleCrack( int i_start, unsigned char * p_crypted, static int CSSTitleCrack( int i_start, unsigned char * p_crypted,
unsigned char * p_decrypted, unsigned char * p_decrypted,
dvd_key_t * p_sector_key, dvd_key_t * p_key ); dvd_key_t * p_sector_key, dvd_key_t * p_key );
...@@ -79,7 +79,8 @@ int CSSTest( dvdcss_handle dvdcss ) ...@@ -79,7 +79,8 @@ int CSSTest( dvdcss_handle dvdcss )
{ {
/* Since it's the first ioctl we try to issue, we add a notice */ /* Since it's the first ioctl we try to issue, we add a notice */
_dvdcss_error( dvdcss, "css error: ioctl_ReadCopyright failed, " _dvdcss_error( dvdcss, "css error: ioctl_ReadCopyright failed, "
"make sure DVD ioctls were compiled in" ); "make sure there is a DVD in the drive, and that "
"DVD ioctls were compiled in this libdvdcss version" );
return i_ret; return i_ret;
} }
...@@ -303,7 +304,7 @@ int CSSGetDiscKey( dvdcss_handle dvdcss ) ...@@ -303,7 +304,7 @@ int CSSGetDiscKey( dvdcss_handle dvdcss )
switch( dvdcss->i_method ) switch( dvdcss->i_method )
{ {
case DVDCSS_KEY: case DVDCSS_METHOD_KEY:
#ifdef HAVE_CSSKEYS #ifdef HAVE_CSSKEYS
/* Decrypt disc key with player keys from csskeys.h */ /* Decrypt disc key with player keys from csskeys.h */
_dvdcss_debug( dvdcss, "decrypting disc key with player keys" ); _dvdcss_debug( dvdcss, "decrypting disc key with player keys" );
...@@ -331,13 +332,13 @@ int CSSGetDiscKey( dvdcss_handle dvdcss ) ...@@ -331,13 +332,13 @@ int CSSGetDiscKey( dvdcss_handle dvdcss )
memcpy( dvdcss->css.disc.p_disc_key, disc_key, KEY_SIZE ); memcpy( dvdcss->css.disc.p_disc_key, disc_key, KEY_SIZE );
break; break;
#else #else
dvdcss->i_method = DVDCSS_DISC; dvdcss->i_method = DVDCSS_METHOD_DISC;
#endif #endif
case DVDCSS_DISC: case DVDCSS_METHOD_DISC:
/* Crack Disc key to be able to use it */ /* Crack Disc key to be able to use it */
_dvdcss_debug( dvdcss, "cracking disc key with key hash" ); _dvdcss_debug( dvdcss, "cracking disc key with key hash" );
_dvdcss_debug( dvdcss, "building 64MB table ... this will take some time" ); _dvdcss_debug( dvdcss, "building 64MB table ... this will take some time" );
CSSDiscCrack( dvdcss->css.disc.p_disc_key ); CSSDiscCrack( dvdcss, dvdcss->css.disc.p_disc_key );
break; break;
default: default:
...@@ -356,7 +357,8 @@ int CSSGetTitleKey( dvdcss_handle dvdcss, int i_pos ) ...@@ -356,7 +357,8 @@ int CSSGetTitleKey( dvdcss_handle dvdcss, int i_pos )
dvd_key_t p_key; dvd_key_t p_key;
int i,j; int i,j;
if( ( dvdcss->i_method == DVDCSS_TITLE ) || ( dvdcss->b_ioctls == 0 ) ) if( ( dvdcss->i_method == DVDCSS_METHOD_TITLE )
|| ( dvdcss->b_ioctls == 0 ) )
{ {
/* /*
* Title key cracking method from Ethan Hawke, * Title key cracking method from Ethan Hawke,
...@@ -488,7 +490,7 @@ int CSSGetTitleKey( dvdcss_handle dvdcss, int i_pos ) ...@@ -488,7 +490,7 @@ int CSSGetTitleKey( dvdcss_handle dvdcss, int i_pos )
memcpy( dvdcss->css.p_title_key, p_key, sizeof(dvd_key_t) ); memcpy( dvdcss->css.p_title_key, p_key, sizeof(dvd_key_t) );
return 0; return 0;
} // ( dvdcss->i_method == DVDCSS_TITLE ) || ( dvdcss->b_ioctls == 0 ) } // (dvdcss->i_method == DVDCSS_METHOD_TITLE) || (dvdcss->b_ioctls == 0)
} }
/***************************************************************************** /*****************************************************************************
...@@ -866,7 +868,7 @@ static int investigate( unsigned char* hash, unsigned char *ckey ) ...@@ -866,7 +868,7 @@ static int investigate( unsigned char* hash, unsigned char *ckey )
return memcmp( key, pkey, 5 ); return memcmp( key, pkey, 5 );
} }
static int CSSDiscCrack( u8 * p_disc_key ) static int CSSDiscCrack( dvdcss_handle dvdcss, u8 * p_disc_key )
{ {
unsigned char B[5] = { 0,0,0,0,0 }; /* Second Stage of mangle cipher */ unsigned char B[5] = { 0,0,0,0,0 }; /* Second Stage of mangle cipher */
unsigned char C[5] = { 0,0,0,0,0 }; /* Output Stage of mangle cipher unsigned char C[5] = { 0,0,0,0,0 }; /* Output Stage of mangle cipher
...@@ -913,7 +915,7 @@ static int CSSDiscCrack( u8 * p_disc_key ) ...@@ -913,7 +915,7 @@ static int CSSDiscCrack( u8 * p_disc_key )
/* /*
if( tmp4 == K1TABLEWIDTH ) if( tmp4 == K1TABLEWIDTH )
{ {
fprintf( stderr, "Table disaster %d", tmp4 ); _dvdcss_debug( dvdcss, "Table disaster %d", tmp4 );
} }
*/ */
if( tmp4 < K1TABLEWIDTH ) if( tmp4 < K1TABLEWIDTH )
...@@ -934,7 +936,7 @@ static int CSSDiscCrack( u8 * p_disc_key ) ...@@ -934,7 +936,7 @@ static int CSSDiscCrack( u8 * p_disc_key )
tmp3 = 0; tmp3 = 0;
fprintf( stderr, "initializing the big table" ); _dvdcss_debug( dvdcss, "initializing the big table" );
for( i = 0 ; i < 16777216 ; i++ ) for( i = 0 ; i < 16777216 ; i++ )
{ {
...@@ -958,7 +960,7 @@ static int CSSDiscCrack( u8 * p_disc_key ) ...@@ -958,7 +960,7 @@ static int CSSDiscCrack( u8 * p_disc_key )
BigTable[j] = i; BigTable[j] = i;
} }
// printf( "\n" ); /* fprintf( stderr, "\n" ); */
/* /*
* We are done initing, now reverse hash * We are done initing, now reverse hash
......
...@@ -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.18 2001/10/16 16:51:28 stef Exp $ * $Id: libdvdcss.c,v 1.19 2001/11/12 20:16:33 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>
...@@ -80,11 +80,12 @@ static int _win32_dvdcss_aread ( int i_fd, void *p_data, int i_blocks ); ...@@ -80,11 +80,12 @@ static int _win32_dvdcss_aread ( int i_fd, void *p_data, int i_blocks );
/***************************************************************************** /*****************************************************************************
* dvdcss_open: initialize library, open a DVD device, crack CSS key * dvdcss_open: initialize library, open a DVD device, crack CSS key
*****************************************************************************/ *****************************************************************************/
extern dvdcss_handle dvdcss_open ( char *psz_target, int i_flags ) extern dvdcss_handle dvdcss_open ( char *psz_target )
{ {
int i_ret; int i_ret;
char psz_method[16] = "dvdcss_method"; char *psz_method = getenv( "DVDCSS_METHOD" );
char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
dvdcss_handle dvdcss; dvdcss_handle dvdcss;
...@@ -92,37 +93,63 @@ extern dvdcss_handle dvdcss_open ( char *psz_target, int i_flags ) ...@@ -92,37 +93,63 @@ extern dvdcss_handle dvdcss_open ( char *psz_target, int i_flags )
dvdcss = malloc( sizeof( struct dvdcss_s ) ); dvdcss = malloc( sizeof( struct dvdcss_s ) );
if( dvdcss == NULL ) if( dvdcss == NULL )
{ {
if( ! (i_flags & DVDCSS_INIT_QUIET) )
{
DVDCSS_ERROR( "could not initialize library" );
}
return NULL; return NULL;
} }
/* Initialize structure */ /* Initialize structure with default values */
dvdcss->p_titles = NULL; dvdcss->p_titles = NULL;
dvdcss->b_debug = i_flags & DVDCSS_INIT_DEBUG;
dvdcss->b_errors = !(i_flags & DVDCSS_INIT_QUIET);
dvdcss->psz_error = "no error"; dvdcss->psz_error = "no error";
dvdcss->i_method = DVDCSS_METHOD_TITLE;
dvdcss->b_debug = 0;
dvdcss->b_errors = 1;
/* Find method from DVDCSS_METHOD environment variable */
if( psz_method != NULL )
/* find method from DVDCSS_METHOD environment variable */ {
dvdcss->i_method = DVDCSS_TITLE; if( !strncmp( psz_method, "key", 4 ) )
{
if( getenv( psz_method ) ) dvdcss->i_method = DVDCSS_METHOD_KEY;
}
else if( !strncmp( psz_method, "disc", 5 ) )
{
dvdcss->i_method = DVDCSS_METHOD_DISC;
}
else if( !strncmp( psz_method, "title", 5 ) )
{ {
if( !strncmp( getenv( psz_method ), "key", 3 ) ) dvdcss->i_method = DVDCSS_METHOD_TITLE;
}
else
{ {
dvdcss->i_method = DVDCSS_KEY; _dvdcss_error( dvdcss, "unknown decrypt method, please choose "
"from 'title', 'key' or 'disc'" );
free( dvdcss );
return NULL;
} }
else if( !strncmp( getenv( psz_method ), "disc", 4 ) ) }
/* Find verbosity from DVDCSS_VERBOSE environment variable */
if( psz_verbose != NULL )
{
switch( atoi( psz_verbose ) )
{ {
dvdcss->i_method = DVDCSS_DISC; case 0:
dvdcss->b_errors = 0;
break;
case 1: