Commit 322cfc68 authored by Stéphane Borel's avatar Stéphane Borel

*the dvd netlist no longer stops when the fifo is empty ; it just waits

that there are free vectors again
parent 495436e7
/***************************************************************************** /*****************************************************************************
* dvd_netlist.c: Specific netlist for DVD packets * dvd_netlist.c: Specific netlist for DVD packets
* --- *****************************************************************************
* The original is in src/input. * The original is in src/input.
* There is only one major change from input_netlist.c : data is now a * There is only one major change from input_netlist.c : data is now a
* pointer to an offset in iovec ; and iovec has a reference counter. It * pointer to an offset in iovec ; and iovec has a reference counter. It
* will only be given back to netlist when refcount is zero. * will only be given back to netlist when refcount is zero.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: dvd_netlist.c,v 1.9 2001/06/03 12:47:21 sam Exp $ * $Id: dvd_netlist.c,v 1.10 2001/06/13 00:03:08 stef Exp $
* *
* Authors: Henri Fallon <henri@videolan.org> * Authors: Henri Fallon <henri@videolan.org>
* Stphane Borel <stef@videolan.org> * Stphane Borel <stef@videolan.org>
...@@ -238,9 +238,9 @@ dvd_netlist_t * DVDNetlistInit( int i_nb_iovec, int i_nb_data, int i_nb_pes, ...@@ -238,9 +238,9 @@ dvd_netlist_t * DVDNetlistInit( int i_nb_iovec, int i_nb_data, int i_nb_pes,
/***************************************************************************** /*****************************************************************************
* DVDGetiovec: returns an iovec pointer for a readv() operation * DVDGetiovec: returns an iovec pointer for a readv() operation
***************************************************************************** *****************************************************************************
* We return an iovec vector, so that readv can read many packets at a time, * We return an iovec vector, so that readv can read many packets at a time.
* and we set pp_data to direct to the fifo pointer, which will allow us * pp_data will be set to direct to the fifo pointer in DVDMviovec, which
* to get the corresponding data_packet. * will allow us to get the corresponding data_packet.
*****************************************************************************/ *****************************************************************************/
struct iovec * DVDGetiovec( void * p_method_data ) struct iovec * DVDGetiovec( void * p_method_data )
{ {
...@@ -249,23 +249,21 @@ struct iovec * DVDGetiovec( void * p_method_data ) ...@@ -249,23 +249,21 @@ struct iovec * DVDGetiovec( void * p_method_data )
/* cast */ /* cast */
p_netlist = (dvd_netlist_t *)p_method_data; p_netlist = (dvd_netlist_t *)p_method_data;
/* check */ /* check that we have enough free iovec */
if( ( while( (
(p_netlist->i_iovec_end - p_netlist->i_iovec_start) (p_netlist->i_iovec_end - p_netlist->i_iovec_start)
& p_netlist->i_nb_iovec ) < p_netlist->i_read_once ) & p_netlist->i_nb_iovec ) < p_netlist->i_read_once )
{ {
intf_ErrMsg("Empty iovec FIFO (%d:%d). Unable to allocate memory", intf_WarnMsg( 12, "input info: waiting for free iovec" );
p_netlist->i_iovec_start, p_netlist->i_iovec_end ); msleep( INPUT_IDLE_SLEEP );
return (NULL);
} }
if( ( while( (
(p_netlist->i_data_end - p_netlist->i_data_start) (p_netlist->i_data_end - p_netlist->i_data_start)
& p_netlist->i_nb_data ) < p_netlist->i_read_once ) & p_netlist->i_nb_data ) < p_netlist->i_read_once )
{ {
intf_ErrMsg("Empty data FIFO (%d:%d). Unable to allocate memory", intf_WarnMsg( 12, "input info: waiting for free data packet" );
p_netlist->i_data_start, p_netlist->i_data_end ); msleep( INPUT_IDLE_SLEEP );
return (NULL);
} }
/* readv only takes contiguous buffers /* readv only takes contiguous buffers
* so, as a solution, we chose to have a FIFO a bit longer * so, as a solution, we chose to have a FIFO a bit longer
......
...@@ -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.71 2001/06/12 22:14:44 sam Exp $ * $Id: input_dvd.c,v 1.72 2001/06/13 00:03:08 stef Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
#define DVD_DATA_READ_ONCE (4 * DVD_BLOCK_READ_ONCE) #define DVD_DATA_READ_ONCE (4 * DVD_BLOCK_READ_ONCE)
/* Size of netlist */ /* Size of netlist */
#define DVD_NETLIST_SIZE 2048 #define DVD_NETLIST_SIZE 256
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_spdif: ac3 passthrough output * aout_spdif: ac3 passthrough output
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: aout_spdif.c,v 1.13 2001/06/12 18:16:49 stef Exp $ * $Id: aout_spdif.c,v 1.14 2001/06/13 00:03:08 stef Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -74,6 +74,7 @@ void aout_SpdifThread( aout_thread_t * p_aout ) ...@@ -74,6 +74,7 @@ void aout_SpdifThread( aout_thread_t * p_aout )
* last significant frame */ * last significant frame */
i_blank = 0; i_blank = 0;
mdelta = 0; mdelta = 0;
mplay = 0;
/* Compute the theorical duration of an ac3 frame */ /* Compute the theorical duration of an ac3 frame */
...@@ -141,7 +142,7 @@ void aout_SpdifThread( aout_thread_t * p_aout ) ...@@ -141,7 +142,7 @@ void aout_SpdifThread( aout_thread_t * p_aout )
if( i_frame ) if( i_frame )
{ {
mwait( mplay ); mwait( mplay + SLEEP_TIME );
} }
else else
{ {
......
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