]> git.sesse.net Git - vlc/commitdiff
- Fixed a netlist packet leak in demuxPSI (Mark Gritter <mgritter@kealia.com>).
authorHenri Fallon <henri@videolan.org>
Thu, 6 Sep 2001 18:21:02 +0000 (18:21 +0000)
committerHenri Fallon <henri@videolan.org>
Thu, 6 Sep 2001 18:21:02 +0000 (18:21 +0000)
- Removed the nuts message "unable to allocate memory" when the netlist got
empty.

- Cosmetic changes.

ChangeLog
plugins/mpeg/input_ts.c
src/input/input_netlist.c
src/input/mpeg_system.c

index cc94c392d40d30aca4ccd6c09a0805c7ba1a80b8..2767ff97168e5fe9b631af8bf2d4c5cbc0bf01f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 94879184755b6e155c5ed4cc93752480c06ac5e1..403cd4de6736b8c4c8c521f496d5a4a1706cda01 100644 (file)
@@ -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 )
         {
index 938edb8fb1c6fd46128d527d4c92984093f46b6e..afcd7feb38ede0a8cff50da2a7177f21280fb873 100644 (file)
@@ -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 );
     }
 
index e83a962ddba66fdf6dcd2053837259fcac02cb2e..6220bfc5fa97645beab6472a1aa338c471d87465 100644 (file)
@@ -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 ;
 }