From 1e107cf7893ae875f33952c2ebb4ccdd1c4d7ec7 Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Tue, 27 Nov 2001 11:44:48 +0000 Subject: [PATCH] New syntax for the dvd input : dvd:[:] The raw device must have been prepared (by root) beforehands. --- plugins/dvd/input_dvd.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/dvd/input_dvd.c b/plugins/dvd/input_dvd.c index 171b06617f..bb896c7722 100644 --- a/plugins/dvd/input_dvd.c +++ b/plugins/dvd/input_dvd.c @@ -10,7 +10,7 @@ * -dvd_udf to find files ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: input_dvd.c,v 1.99 2001/11/25 22:52:21 gbazin Exp $ + * $Id: input_dvd.c,v 1.100 2001/11/27 11:44:48 massiot Exp $ * * Author: Stéphane Borel * @@ -310,6 +310,8 @@ static void DVDInit( input_thread_t * p_input ) static void DVDOpen( struct input_thread_s *p_input ) { dvdcss_handle dvdhandle; + char * psz_parser; + char * psz_device; vlc_mutex_lock( &p_input->stream.stream_lock ); @@ -323,17 +325,35 @@ static void DVDOpen( struct input_thread_s *p_input ) vlc_mutex_unlock( &p_input->stream.stream_lock ); - /* XXX: put this shit in an access plugin */ + /* Parse input string : dvd:device[:rawdevice] */ if( strlen( p_input->p_source ) > 4 && !strncasecmp( p_input->p_source, "dvd:", 4 ) ) { - dvdhandle = dvdcss_open( p_input->p_source + 4 ); + psz_parser = psz_device = p_input->p_source + 4; } else { - dvdhandle = dvdcss_open( p_input->p_source ); + psz_parser = psz_device = p_input->p_source; } + while( *psz_parser && *psz_parser != ':' ) + { + *psz_parser++; + } + + if( *psz_parser == ':' ) + { + /* Found raw device */ + *psz_parser = '\0'; + psz_parser++; + + main_PutPszVariable( "DVDCSS_RAW_DEVICE", psz_parser ); + } + + intf_WarnMsg( 2, "input: dvd=%s raw=%s", psz_device, psz_parser ); + + dvdhandle = dvdcss_open( psz_device ); + if( dvdhandle == NULL ) { intf_ErrMsg( "dvd error: dvdcss can't open device" );