Commit a9c31c5a authored by Henri Fallon's avatar Henri Fallon

- Fixed a netlist packet leak in demuxPSI (Mark Gritter <mgritter@kealia.com>).

- Removed the nuts message "unable to allocate memory" when the netlist got
empty.

- Cosmetic changes.
parent 9ad4cc80
......@@ -4,7 +4,8 @@
HEAD
* Added gnome.h check and cleaned the error messages in the configure script
* Fixed a packet leak in DemuxPSI.
* Added gnome.h check and cleaned the error messages in the configure script.
* Tiny small optim in LPCM decoder.
0.2.83
......
......@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ts.c,v 1.32 2001/08/27 16:13:20 massiot Exp $
* $Id: input_ts.c,v 1.33 2001/09/06 18:21:02 henri Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
......@@ -280,14 +280,6 @@ static int TSRead( input_thread_t * p_input,
struct iovec * p_iovec;
struct timeval timeout;
/* Get iovecs */
p_iovec = input_NetlistGetiovec( p_input->p_method_data );
if ( p_iovec == NULL )
{
return( -1 ); /* empty netlist */
}
/* Init */
p_method = ( thread_ts_data_t * )p_input->p_plugin_data;
......@@ -316,9 +308,17 @@ static int TSRead( input_thread_t * p_input,
intf_ErrMsg( "input error: TS select error (%s)", strerror(errno) );
return( -1 );
}
if( i_data )
{
/* Get iovecs */
p_iovec = input_NetlistGetiovec( p_input->p_method_data );
if ( p_iovec == NULL )
{
return( -1 ); /* empty netlist */
}
#if defined( WIN32 )
if( p_input->stream.b_pace_control )
{
......
......@@ -2,7 +2,7 @@
* input_netlist.c: netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_netlist.c,v 1.41 2001/07/30 00:53:05 sam Exp $
* $Id: input_netlist.c,v 1.42 2001/09/06 18:21:02 henri Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
......@@ -212,7 +212,7 @@ struct iovec * input_NetlistGetiovec( void * p_method_data )
( (p_netlist->i_data_end - p_netlist->i_data_start + p_netlist->i_nb_data)
& ( p_netlist->i_nb_data -1 ) ) < p_netlist->i_read_once )
{
intf_ErrMsg("Empty iovec FIFO. Unable to allocate memory");
intf_ErrMsg("Empty iovec FIFO.");
return (NULL);
}
......@@ -303,7 +303,7 @@ struct data_packet_s * input_NetlistNewPacket( void * p_method_data,
/* check */
if ( p_netlist->i_data_start == p_netlist->i_data_end )
{
intf_ErrMsg("Empty Data FIFO in netlist. Unable to allocate memory");
intf_ErrMsg("Empty Data FIFO in netlist.");
return ( NULL );
}
......@@ -342,7 +342,7 @@ struct pes_packet_s * input_NetlistNewPES( void * p_method_data )
/* check */
if ( p_netlist->i_pes_start == p_netlist->i_pes_end )
{
intf_ErrMsg("Empty PES FIFO in netlist - Unable to allocate memory");
intf_ErrMsg("Empty PES FIFO in netlist");
return ( NULL );
}
......
......@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.56 2001/07/18 15:21:51 massiot Exp $
* $Id: mpeg_system.c,v 1.57 2001/09/06 18:21:02 henri Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -1256,6 +1256,18 @@ void input_DemuxPSI( input_thread_t * p_input, data_packet_t * p_data,
{
/* This was the last section of PSI */
p_psi->b_is_complete = 1;
switch( p_demux_data->i_psi_type)
{
case PSI_IS_PAT:
input_DecodePAT( p_input, p_es );
break;
case PSI_IS_PMT:
input_DecodePMT( p_input, p_es );
break;
default:
intf_WarnMsg(2, "Received unknown PSI in demuxPSI");
}
}
}
else
......@@ -1267,22 +1279,10 @@ void input_DemuxPSI( input_thread_t * p_input, data_packet_t * p_data,
}
}
if ( p_psi->b_is_complete )
{
switch( p_demux_data->i_psi_type)
{
case PSI_IS_PAT:
input_DecodePAT( p_input, p_es );
break;
case PSI_IS_PMT:
input_DecodePMT( p_input, p_es );
break;
default:
intf_WarnMsg(2, "Received unknown PSI in demuxPSI");
}
}
#undef p_psi
#undef p
p_input->pf_delete_packet( p_input->p_method_data, p_data );
return ;
}
......
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