summaryrefslogtreecommitdiffstats
path: root/libdvdcss
diff options
context:
space:
mode:
Diffstat (limited to 'libdvdcss')
-rw-r--r--libdvdcss/common.h2
-rw-r--r--libdvdcss/css.c7
-rw-r--r--libdvdcss/css.h2
-rw-r--r--libdvdcss/csstables.h2
-rw-r--r--libdvdcss/device.c4
-rw-r--r--libdvdcss/device.h6
-rw-r--r--libdvdcss/dvdcss/dvdcss.h8
-rw-r--r--libdvdcss/error.c2
-rw-r--r--libdvdcss/ioctl.c6
-rw-r--r--libdvdcss/ioctl.h2
-rw-r--r--libdvdcss/libdvdcss.c32
-rw-r--r--libdvdcss/libdvdcss.h4
12 files changed, 48 insertions, 29 deletions
diff --git a/libdvdcss/common.h b/libdvdcss/common.h
index 8e97fc3ab1..aff5ccbaa7 100644
--- a/libdvdcss/common.h
+++ b/libdvdcss/common.h
@@ -5,7 +5,7 @@
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id$
*
- * Authors: Samuel Hocevar <sam@via.ecp.fr>
+ * Authors: Sam Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
*
diff --git a/libdvdcss/css.c b/libdvdcss/css.c
index a704a3fcf9..4e24bbf68f 100644
--- a/libdvdcss/css.c
+++ b/libdvdcss/css.c
@@ -1,11 +1,11 @@
/*****************************************************************************
* css.c: Functions for DVD authentication and descrambling
*****************************************************************************
- * Copyright (C) 1999-2003 VideoLAN
+ * Copyright (C) 1999-2008 VideoLAN
* $Id$
*
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- * Håkan Hjort <d95hjort@dtek.chalmers.se>
+ * Authors: Stéphane Borel <stef@via.ecp.fr>
+ * HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
*
* based on:
* - css-auth by Derek Fawcus <derek@spider.com>
@@ -325,6 +325,7 @@ int _dvdcss_disckey( dvdcss_t dvdcss )
"cracking title keys instead" );
/* Fallback, but not to DISC as the disc key might be faulty */
+ memset( p_disc_key, 0, KEY_SIZE );
dvdcss->i_method = DVDCSS_METHOD_TITLE;
break;
diff --git a/libdvdcss/css.h b/libdvdcss/css.h
index 82f64f8951..03becda17c 100644
--- a/libdvdcss/css.h
+++ b/libdvdcss/css.h
@@ -4,7 +4,7 @@
* Copyright (C) 1999-2001 VideoLAN
* $Id$
*
- * Author: Stéphane Borel <stef@via.ecp.fr>
+ * Author: Stéphane Borel <stef@via.ecp.fr>
*
* based on:
* - css-auth by Derek Fawcus <derek@spider.com>
diff --git a/libdvdcss/csstables.h b/libdvdcss/csstables.h
index fb3cdfef47..bd0fc3a706 100644
--- a/libdvdcss/csstables.h
+++ b/libdvdcss/csstables.h
@@ -4,7 +4,7 @@
* Copyright (C) 1999-2001 VideoLAN
* $Id$
*
- * Author: Stéphane Borel <stef@via.ecp.fr>
+ * Author: Stéphane Borel <stef@via.ecp.fr>
*
* based on:
* - css-auth by Derek Fawcus <derek@spider.com>
diff --git a/libdvdcss/device.c b/libdvdcss/device.c
index 8185f17d21..0d8e4a06ee 100644
--- a/libdvdcss/device.c
+++ b/libdvdcss/device.c
@@ -4,9 +4,9 @@
* Copyright (C) 1998-2006 VideoLAN
* $Id$
*
- * Authors: Stéphane Borel <stef@via.ecp.fr>
+ * Authors: Stéphane Borel <stef@via.ecp.fr>
* Sam Hocevar <sam@zoy.org>
- * Håkan Hjort <d95hjort@dtek.chalmers.se>
+ * HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/libdvdcss/device.h b/libdvdcss/device.h
index 867703172b..d8a73f0d4e 100644
--- a/libdvdcss/device.h
+++ b/libdvdcss/device.h
@@ -4,9 +4,9 @@
* Copyright (C) 1998-2002 VideoLAN
* $Id$
*
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- * Samuel Hocevar <sam@zoy.org>
- * Håkan Hjort <d95hjort@dtek.chalmers.se>
+ * Authors: Stéphane Borel <stef@via.ecp.fr>
+ * Sam Hocevar <sam@zoy.org>
+ * HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/libdvdcss/dvdcss/dvdcss.h b/libdvdcss/dvdcss/dvdcss.h
index 959e796ceb..c97f996824 100644
--- a/libdvdcss/dvdcss/dvdcss.h
+++ b/libdvdcss/dvdcss/dvdcss.h
@@ -1,7 +1,7 @@
/**
* \file dvdcss.h
- * \author Stéphane Borel <stef@via.ecp.fr>
- * \author Samuel Hocevar <sam@zoy.org>
+ * \author Stéphane Borel <stef@via.ecp.fr>
+ * \author Sam Hocevar <sam@zoy.org>
* \brief The \e libdvdcss public header.
*
* This header contains the public types and functions that applications
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (C) 1998-2002 VideoLAN
+ * Copyright (C) 1998-2008 VideoLAN
* $Id$
*
* This program is free software; you can redistribute it and/or modify
@@ -88,6 +88,8 @@ LIBDVDCSS_EXPORT int dvdcss_readv ( dvdcss_t,
int i_flags );
LIBDVDCSS_EXPORT char * dvdcss_error ( dvdcss_t );
+LIBDVDCSS_EXPORT int dvdcss_is_scrambled ( dvdcss_t );
+
/*
* Deprecated stuff.
diff --git a/libdvdcss/error.c b/libdvdcss/error.c
index d5c416ff61..66d2b67ad4 100644
--- a/libdvdcss/error.c
+++ b/libdvdcss/error.c
@@ -4,7 +4,7 @@
* Copyright (C) 1998-2002 VideoLAN
* $Id$
*
- * Author: Samuel Hocevar <sam@zoy.org>
+ * Author: Sam Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/libdvdcss/ioctl.c b/libdvdcss/ioctl.c
index 119a7afc2a..d0903994c7 100644
--- a/libdvdcss/ioctl.c
+++ b/libdvdcss/ioctl.c
@@ -5,11 +5,11 @@
* $Id$
*
* Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
- * Samuel Hocevar <sam@zoy.org>
+ * Sam Hocevar <sam@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
- * Håkan Hjort <d95hjort@dtek.chalmers.se>
+ * HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
- * David Siebörger <drs-videolan@rucus.ru.ac.za>
+ * David Siebörger <drs-videolan@rucus.ru.ac.za>
* Alex Strelnikov <lelik@os2.ru>
* Gildas Bazin <gbazin@netcourrier.com>
*
diff --git a/libdvdcss/ioctl.h b/libdvdcss/ioctl.h
index aa33b50ba1..16f51d251b 100644
--- a/libdvdcss/ioctl.h
+++ b/libdvdcss/ioctl.h
@@ -4,7 +4,7 @@
* Copyright (C) 1999-2001 VideoLAN
* $Id$
*
- * Authors: Samuel Hocevar <sam@zoy.org>
+ * Authors: Sam Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/libdvdcss/libdvdcss.c b/libdvdcss/libdvdcss.c
index 9d992d635d..1be814f838 100644
--- a/libdvdcss/libdvdcss.c
+++ b/libdvdcss/libdvdcss.c
@@ -1,10 +1,10 @@
/* libdvdcss.c: DVD reading library.
*
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- * Samuel Hocevar <sam@zoy.org>
- * Håkan Hjort <d95hjort@dtek.chalmers.se>
+ * Authors: Stéphane Borel <stef@via.ecp.fr>
+ * Sam Hocevar <sam@zoy.org>
+ * HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
*
- * Copyright (C) 1998-2002 VideoLAN
+ * Copyright (C) 1998-2008 VideoLAN
* $Id$
*
* This program is free software; you can redistribute it and/or modify
@@ -371,10 +371,13 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
if( i_ret < 0 )
{
- print_debug( dvdcss,
- "could not get disc key" );
+ print_debug( dvdcss, "could not get disc key" );
}
}
+ else
+ {
+ memset( dvdcss->css.p_disc_key, 0, KEY_SIZE );
+ }
/* If the cache is enabled, write the cache directory tag */
if( psz_cache )
@@ -470,7 +473,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
{
char psz_tmp[16 + 1];
sprintf( psz_tmp,
- "%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"%.2"PRIx8"",
+ "%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
psz_serial[0], psz_serial[1], psz_serial[2],
psz_serial[3], psz_serial[4], psz_serial[5],
psz_serial[6], psz_serial[7] );
@@ -486,7 +489,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
psz_key[0] = '-';
for( i = 0; i < KEY_SIZE; i++ )
{
- sprintf( &psz_key[1+i*2], "%.2"PRIx8, dvdcss->css.p_disc_key[i] );
+ sprintf( &psz_key[1+i*2], "%.2x", dvdcss->css.p_disc_key[i] );
}
psz_key[1 + KEY_SIZE * 2] = '\0';
}
@@ -793,3 +796,16 @@ LIBDVDCSS_EXPORT int dvdcss_title ( dvdcss_t dvdcss, int i_block )
return _dvdcss_title( dvdcss, i_block );
}
+/**
+ * \brief Return 1 if the DVD is scrambled, 0 otherwise.
+ *
+ * \param dvdcss a \e libdvdcss instance.
+ * \return 1 if the DVD is scrambled, 0 otherwise.
+ *
+ * This function returns whether the DVD is scrambled.
+ */
+LIBDVDCSS_EXPORT int dvdcss_is_scrambled ( dvdcss_t dvdcss )
+{
+ return dvdcss->b_scrambled;
+}
+
diff --git a/libdvdcss/libdvdcss.h b/libdvdcss/libdvdcss.h
index 9fad5d84ce..80f78c3062 100644
--- a/libdvdcss/libdvdcss.h
+++ b/libdvdcss/libdvdcss.h
@@ -4,8 +4,8 @@
* Copyright (C) 1998-2001 VideoLAN
* $Id$
*
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- * Samuel Hocevar <sam@zoy.org>
+ * Authors: Stéphane Borel <stef@via.ecp.fr>
+ * Sam Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by