Commit 81d10098 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 9d176b9b
......@@ -2,7 +2,7 @@
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: dvd.c,v 1.34 2002/07/31 20:56:51 sam Exp $
* $Id: dvd.c,v 1.35 2002/08/01 12:58:38 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -61,9 +61,29 @@ static void UnprobeLibDVDCSS( void );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#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.")
static char *cssmethod_list[] = { "title", "disc", "key", NULL };
vlc_module_begin();
int i;
add_category_hint( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"), NULL );
add_string_from_list( "dvd-css-method", NULL, cssmethod_list, NULL,
CSSMETHOD_TEXT, CSSMETHOD_LONGTEXT );
#ifdef GOD_DAMN_DMCA
set_description( _("DVD input module, uses libdvdcss if installed") );
i = 90;
......
......@@ -8,7 +8,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_access.c,v 1.22 2002/07/31 20:56:51 sam Exp $
* $Id: dvd_access.c,v 1.23 2002/08/01 12:58:38 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -88,11 +88,12 @@ static char * DVDParse( input_thread_t * );
*****************************************************************************/
int E_(DVDOpen) ( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
input_thread_t * p_input = (input_thread_t *)p_this;
char * psz_device;
thread_dvd_data_t * p_dvd;
input_area_t * p_area;
int i;
char * psz_dvdcss_env;
p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL )
......@@ -119,6 +120,28 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
*/
p_input->i_mtu = 0;
/* override environment variable DVDCSS_METHOD with config option
* (FIXME: this creates a small memory leak) */
psz_dvdcss_env = config_GetPsz( p_input, "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
*/
......
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