Commit 1e107cf7 authored by Christophe Massiot's avatar Christophe Massiot

New syntax for the dvd input :

   dvd:<device>[:<raw device>]
The raw device must have been prepared (by root) beforehands.
parent caa99b31
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * 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: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -310,6 +310,8 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -310,6 +310,8 @@ static void DVDInit( input_thread_t * p_input )
static void DVDOpen( struct input_thread_s *p_input ) static void DVDOpen( struct input_thread_s *p_input )
{ {
dvdcss_handle dvdhandle; dvdcss_handle dvdhandle;
char * psz_parser;
char * psz_device;
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
...@@ -323,17 +325,35 @@ static void DVDOpen( struct input_thread_s *p_input ) ...@@ -323,17 +325,35 @@ static void DVDOpen( struct input_thread_s *p_input )
vlc_mutex_unlock( &p_input->stream.stream_lock ); 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 if( strlen( p_input->p_source ) > 4
&& !strncasecmp( p_input->p_source, "dvd:", 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 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 ) if( dvdhandle == NULL )
{ {
intf_ErrMsg( "dvd error: dvdcss can't open device" ); intf_ErrMsg( "dvd error: dvdcss can't open device" );
......
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