Commit 9e8fd6f5 authored by Gildas Bazin's avatar Gildas Bazin

* Added a --dvd-css-method config option to the dvd plugin. This is implemented with
putenv() and is IMHO a quick hack (leads to memory leaks) as libdvdcss should rather
allow us to change this value using the API!
parent 8ff3851c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvd.c : DVD input module for vlc * dvd.c : DVD input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: dvd.c,v 1.31 2002/04/19 13:56:10 sam Exp $ * $Id: dvd.c,v 1.31.2.1 2002/08/01 12:59:43 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -62,8 +62,25 @@ static void UnprobeLibDVDCSS( void ); ...@@ -62,8 +62,25 @@ static void UnprobeLibDVDCSS( void );
/***************************************************************************** /*****************************************************************************
* Build configuration tree. * Build configuration tree.
*****************************************************************************/ *****************************************************************************/
#define CSSMETHOD_TEXT N_("Method to use by libdvdcss for key decryption")
#define CSSMETHOD_LONGTEXT N_( \
"title: decrypted title key is guessed from the encrypted sectors of " \
"the stream. Thus it should work with a file as well as the " \
"DVD device. But it sometimes takes much time to decrypt a title " \
"key and may even fail. With this method, the key is only checked "\
"at the beginning of each title, so it won't work if the key " \
"changes in the middle of a title.\n" \
"disc: the disc key is first cracked, then all title keys can be " \
"decrypted instantly, which allows us to check them often.\n" \
"key: the same as \"disc\" if you don't have a file with player keys " \
"at compilation time. If you do, the decryption of the disc key " \
"will be faster with this method. It is the one that was used by " \
"libcss.\n" \
"The default method is: key.")
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"), NULL ) ADD_CATEGORY_HINT( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"), NULL )
ADD_STRING( "dvd-css-method", NULL, NULL, CSSMETHOD_TEXT, CSSMETHOD_LONGTEXT )
MODULE_CONFIG_STOP MODULE_CONFIG_STOP
MODULE_INIT_START MODULE_INIT_START
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_access.c,v 1.19 2002/05/21 13:34:31 gbazin Exp $ * $Id: dvd_access.c,v 1.19.2.1 2002/08/01 12:59:43 gbazin Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -114,6 +114,7 @@ static int DVDOpen( struct input_thread_s *p_input ) ...@@ -114,6 +114,7 @@ static int DVDOpen( struct input_thread_s *p_input )
thread_dvd_data_t * p_dvd; thread_dvd_data_t * p_dvd;
input_area_t * p_area; input_area_t * p_area;
int i; int i;
char * psz_dvdcss_env;
p_dvd = malloc( sizeof(thread_dvd_data_t) ); p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL ) if( p_dvd == NULL )
...@@ -135,6 +136,28 @@ static int DVDOpen( struct input_thread_s *p_input ) ...@@ -135,6 +136,28 @@ static int DVDOpen( struct input_thread_s *p_input )
*/ */
p_input->i_mtu = 0; p_input->i_mtu = 0;
/* override environment variable DVDCSS_METHOD with config option
* (FIXME: this creates a small memory leak) */
psz_dvdcss_env = config_GetPszVariable( "dvd-css-method" );
if( psz_dvdcss_env && *psz_dvdcss_env )
{
char *psz_env;
psz_env = malloc( strlen("DVDCSS_METHOD=") +
strlen( psz_dvdcss_env ) + 1 );
if( !psz_env )
{
free( p_dvd );
return -1;
}
sprintf( psz_env, "%s%s", "DVDCSS_METHOD=", psz_dvdcss_env );
putenv( psz_env );
}
if( psz_dvdcss_env ) free( psz_dvdcss_env );
/* /*
* get plugin ready * get plugin ready
*/ */
......
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