* will only be given back to netlist when refcount is zero.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
- * $Id: dvd_netlist.c,v 1.10 2001/06/13 00:03:08 stef Exp $
+ * $Id: dvd_netlist.c,v 1.11 2001/06/15 05:12:30 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
* Stéphane Borel <stef@videolan.org>
p_netlist = (dvd_netlist_t *)p_method_data;
/* check that we have enough free iovec */
- while( (
+ if( (
(p_netlist->i_iovec_end - p_netlist->i_iovec_start)
& p_netlist->i_nb_iovec ) < p_netlist->i_read_once )
{
intf_WarnMsg( 12, "input info: waiting for free iovec" );
msleep( INPUT_IDLE_SLEEP );
+
+ while( (
+ (p_netlist->i_iovec_end - p_netlist->i_iovec_start)
+ & p_netlist->i_nb_iovec ) < p_netlist->i_read_once )
+ {
+ msleep( INPUT_IDLE_SLEEP );
+ }
+
+ intf_WarnMsg( 12, "input info: found free iovec" );
}
- while( (
+ if( (
(p_netlist->i_data_end - p_netlist->i_data_start)
& p_netlist->i_nb_data ) < p_netlist->i_read_once )
{
intf_WarnMsg( 12, "input info: waiting for free data packet" );
msleep( INPUT_IDLE_SLEEP );
+
+ while( (
+ (p_netlist->i_data_end - p_netlist->i_data_start)
+ & p_netlist->i_nb_data ) < p_netlist->i_read_once )
+ {
+ msleep( INPUT_IDLE_SLEEP );
+ }
+
+ intf_WarnMsg( 12, "input info: found free data packet" );
}
+
/* readv only takes contiguous buffers
* so, as a solution, we chose to have a FIFO a bit longer
* than i_nb_data, and copy the begining of the FIFO to its end
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.75 2001/06/15 01:22:58 stef Exp $
+ * $Id: input_dvd.c,v 1.76 2001/06/15 05:12:30 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
input_thread_t * p_input = (input_thread_t *)p_data;
char * psz_name = p_input->p_source;
- dvdcss_handle dvdhandle;
int i_score = 5;
if( TestMethod( INPUT_METHOD_VAR, "dvd" ) )
psz_name += 4;
}
- dvdhandle = dvdcss_open( psz_name, DVDCSS_INIT_QUIET );
- if( dvdhandle == NULL )
- {
- return( 0 );
- }
-
return( i_score );
}
p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL;
- /* XXX: put this shit in an access plugin */
- if( strlen( p_input->p_source ) > 4
- && !strncasecmp( p_input->p_source, "dvd:", 4 ) )
- {
- p_dvd->dvdhandle = dvdcss_open( p_input->p_source + 4,
- DVDCSS_INIT_QUIET );
- }
- else
- {
- p_dvd->dvdhandle = dvdcss_open( p_input->p_source,
- DVDCSS_INIT_QUIET );
- }
-
- if( p_dvd->dvdhandle == NULL )
- {
- free( p_dvd );
- p_input->b_error = 1;
- return;
- }
+ p_dvd->dvdhandle = (dvdcss_handle) p_input->i_handle;
dvdcss_seek( p_dvd->dvdhandle, 0 );
return;
}
+/*****************************************************************************
+ * DVDOpen: open dvd
+ *****************************************************************************/
+static void DVDOpen( struct input_thread_s *p_input )
+{
+ dvdcss_handle dvdhandle;
+
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+
+ /* If we are here we can control the pace... */
+ p_input->stream.b_pace_control = 1;
+
+ p_input->stream.b_seekable = 1;
+ p_input->stream.p_selected_area->i_size = 0;
+
+ p_input->stream.p_selected_area->i_tell = 0;
+
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+ /* XXX: put this shit in an access plugin */
+ if( strlen( p_input->p_source ) > 4
+ && !strncasecmp( p_input->p_source, "dvd:", 4 ) )
+ {
+ dvdhandle = dvdcss_open( p_input->p_source + 4,
+ DVDCSS_INIT_QUIET );
+ }
+ else
+ {
+ dvdhandle = dvdcss_open( p_input->p_source,
+ DVDCSS_INIT_QUIET );
+ }
+
+ if( dvdhandle == NULL )
+ {
+ p_input->b_error = 1;
+ return;
+ }
+
+ p_input->i_handle = (int) dvdhandle;
+}
+
+/*****************************************************************************
+ * DVDClose: close dvd
+ *****************************************************************************/
+static void DVDClose( struct input_thread_s *p_input )
+{
+ /* Clean up libdvdcss */
+ dvdcss_close( (dvdcss_handle) p_input->i_handle );
+}
+
/*****************************************************************************
* DVDEnd: frees unused data
*****************************************************************************/
IfoDestroy( p_dvd->p_ifo );
- /* Clean up libdvdcss */
- dvdcss_close( p_dvd->dvdhandle );
-
free( p_dvd );
DVDNetlistEnd( p_netlist );
return;
}
-static void DVDOpen ( struct input_thread_s *p_input )
-{
- return;
-}
-
-static void DVDClose ( struct input_thread_s *p_input )
-{
- return;
-}
-
#define cell p_dvd->p_ifo->vts.cell_inf
/*****************************************************************************