[dvblast-devel] [PATCH 4/6] Move MAX_PIDS definition to dvblast.h and use it.

Georgi Chorbadzhiyski gf at unixsol.org
Mon Aug 29 10:36:47 CEST 2011


---
 demux.c   |    5 ++---
 dvblast.h |    1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/demux.c b/demux.c
index 9c1a609..95162cf 100644
--- a/demux.c
+++ b/demux.c
@@ -54,7 +54,6 @@ extern bool b_enable_ecm;
 /*****************************************************************************
  * Local declarations
  *****************************************************************************/
-#define MAX_PIDS                8192
 #define MIN_SECTION_FRAGMENT    PSI_HEADER_SIZE_SYNTAX1
 
 typedef struct ts_pid_t
@@ -143,7 +142,7 @@ void demux_Open( void )
 
     pf_Open();
 
-    for ( i = 0; i < 8192; i++ )
+    for ( i = 0; i < MAX_PIDS; i++ )
     {
         p_pids[i].i_last_cc = -1;
         p_pids[i].i_demux_fd = -1;
@@ -198,7 +197,7 @@ void demux_Close( void )
     psi_table_free( pp_current_sdt_sections );
     psi_table_free( pp_next_sdt_sections );
 
-    for ( i = 0; i < 8192; i++ )
+    for ( i = 0; i < MAX_PIDS; i++ )
     {
         free( p_pids[i].p_psi_buffer );
         for ( j = 0; j < p_pids[i].i_nb_outputs; j++ )
diff --git a/dvblast.h b/dvblast.h
index 96b1594..7508fa5 100644
--- a/dvblast.h
+++ b/dvblast.h
@@ -30,6 +30,7 @@
 
 #define DEFAULT_PORT 3001
 #define TS_SIZE 188
+#define MAX_PIDS 8192
 #define DEFAULT_IPV4_MTU 1500
 #define DEFAULT_IPV6_MTU 1280
 #define PADDING_PID 8191
-- 
1.7.5.1



More information about the dvblast-devel mailing list