]> git.sesse.net Git - vlc/blobdiff - src/input/input_netlist.c
- �a compile sous FreeBSD (mais �a ne tourne pas)
[vlc] / src / input / input_netlist.c
index d6875e1476257ed55fc935d3e1f1cc1116124140..e1b2b398dc4f661b7be7ef27d7d1fbcd9d7e77b3 100644 (file)
@@ -1,36 +1,54 @@
-/*******************************************************************************
- * netlist.c: input thread 
- * (c)1998 VideoLAN
- *******************************************************************************
+/*****************************************************************************
+ * netlist.c: input thread
  * Manages the TS and PES netlists (see netlist.h).
- *******************************************************************************/
-
-/*******************************************************************************
+ *****************************************************************************
+ * Copyright (C) 1998, 1999, 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
  * Preamble
- *******************************************************************************/
-#include <sys/uio.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
+ *****************************************************************************/
+#include <sys/types.h>                        /* on BSD, uio.h needs types.h */
+#include <sys/uio.h>                                            /* "input.h" */
+
+#include <stdlib.h>                                                /* free() */
+#include <string.h>                                            /* strerror() */
+#include <errno.h>                                                  /* errno */
 
 #include "common.h"
 #include "config.h"
 #include "mtime.h"
-#include "vlc_thread.h"
+#include "threads.h"
 #include "intf_msg.h"
 #include "debug.h"
 #include "input.h"
 #include "input_netlist.h"
 
-/******************************************************************************
+/*****************************************************************************
  * Local prototypes
- ******************************************************************************/
+ *****************************************************************************/
 
-/******************************************************************************
+/*****************************************************************************
  * input_NetlistOpen: initialize the netlists buffers
- ******************************************************************************/
-int input_NetlistOpen( input_thread_t *p_input )
+ *****************************************************************************/
+int input_NetlistInit( input_thread_t *p_input )
 {
     int                 i_base, i_packets, i_iovec;
 
@@ -63,7 +81,7 @@ int input_NetlistOpen( input_thread_t *p_input )
         return( -1 );
     }
 
-    /* Allocate a big piece of memory to contain the INPUT_MAX_PES PES packets */
+  /* Allocate a big piece of memory to contain the INPUT_MAX_PES PES packets */
     if( !( p_input->netlist.p_pes_packets = malloc( (INPUT_MAX_PES + 1)
                                              * sizeof(pes_packet_t) ) ) )
     {
@@ -84,7 +102,7 @@ int input_NetlistOpen( input_thread_t *p_input )
     for( i_packets = 0; i_packets < INPUT_MAX_TS + 1; i_packets++ )
     {
         p_input->netlist.p_ts_free[i_base + i_packets].iov_base
-                              = (p_input->netlist.p_ts_packets + i_packets);
+                          = (void *)(p_input->netlist.p_ts_packets + i_packets);
         /* Initialize TS length. */
         (p_input->netlist.p_ts_packets[i_packets]).i_payload_end = TS_PACKET_SIZE;
     }
@@ -115,10 +133,10 @@ int input_NetlistOpen( input_thread_t *p_input )
     return( 0 );
 }
 
-/******************************************************************************
+/*****************************************************************************
  * input_NetlistClean: clean the netlists buffers
- ******************************************************************************/
-void input_NetlistClean( input_thread_t *p_input )
+ *****************************************************************************/
+void input_NetlistEnd( input_thread_t *p_input )
 {
     int i;
 
@@ -129,9 +147,9 @@ void input_NetlistClean( input_thread_t *p_input )
        been allocated */
     for( i = 0; i < INPUT_MAX_PES + 1; i++ )
     {
-      byte_t* p_buffer = p_input->netlist.p_pes_packets[i].p_pes_header_save;
-      if(p_buffer)
-       free(p_buffer);
+        byte_t* p_buffer = p_input->netlist.p_pes_packets[i].p_pes_header_save;
+        if(p_buffer)
+            free(p_buffer);
     }
 
     /* free PES netlist */