[vlc-commits] mux: ts: fix some types

Francois Cartegnie git at videolan.org
Tue Dec 13 14:52:54 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 13 11:07:10 2016 +0100| [59e52265a1dc55652f07f64d57dd971c917555c6] | committer: Francois Cartegnie

mux: ts: fix some types

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=59e52265a1dc55652f07f64d57dd971c917555c6
---

 modules/mux/mpeg/streams.h | 8 ++++----
 modules/mux/mpeg/tables.c  | 4 ++--
 modules/mux/mpeg/ts.c      | 4 ++--
 modules/mux/mpeg/tsutil.c  | 2 +-
 modules/mux/mpeg/tsutil.h  | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/mux/mpeg/streams.h b/modules/mux/mpeg/streams.h
index 70cc3fe..1dcd150 100644
--- a/modules/mux/mpeg/streams.h
+++ b/modules/mux/mpeg/streams.h
@@ -22,9 +22,9 @@
 
 typedef struct
 {
-    int             i_pid;
+    uint16_t        i_pid;
 
-    int             i_continuity_counter;
+    uint8_t         i_continuity_counter;
     bool            b_discontinuity;
 
 } ts_stream_t;
@@ -41,11 +41,11 @@ typedef struct
     /* Specific to mpeg4 in mpeg2ts */
     int             i_es_id;
 
-    int             i_extra;
+    size_t          i_extra;
     uint8_t         *p_extra;
 
     /* language is iso639-2T */
-    int             i_langs;
+    size_t          i_langs;
     uint8_t         *lang;
 } pes_stream_t;
 
diff --git a/modules/mux/mpeg/tables.c b/modules/mux/mpeg/tables.c
index 4012c66..e4d7db1 100644
--- a/modules/mux/mpeg/tables.c
+++ b/modules/mux/mpeg/tables.c
@@ -216,7 +216,7 @@ static void GetPMTmpeg4( vlc_object_t *p_object, dvbpsi_pmt_t *p_dvbpmt,
             bits_write( &bits, 8,   0x05 ); /* tag */
             bits_write( &bits, 24, GetDescriptorLength24b(
                         p_stream->pes->i_extra ) );
-            for (int j = 0; j < p_stream->pes->i_extra; j++ )
+            for (size_t j = 0; j < p_stream->pes->i_extra; j++ )
             {
                 bits_write( &bits, 8,
                     ((uint8_t*)p_stream->pes->p_extra)[j] );
@@ -418,7 +418,7 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
         else if( p_stream->pes->i_stream_type == 0xa0 )
         {
             uint8_t data[512];
-            int i_extra = __MIN( p_stream->pes->i_extra, 502 );
+            size_t i_extra = __MIN( p_stream->pes->i_extra, 502 );
 
             /* private DIV3 descripor */
             memcpy( &data[0], &p_stream->pes->i_codec, 4 );
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index 5790f17..f403372 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -922,7 +922,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
         p_stream->pes.i_height = p_input->fmt.video.i_height;
     }
 
-    p_stream->pes.i_stream_type = -1;
+    p_stream->pes.i_stream_type = 0x00;
     switch( p_input->p_fmt->i_codec )
     {
     /* VIDEO */
@@ -1024,7 +1024,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
         break;
     }
 
-    if (p_stream->pes.i_stream_type == -1)
+    if (p_stream->pes.i_stream_type == 0x00)
     {
         msg_Warn( p_mux, "rejecting stream with unsupported codec %4.4s",
                   (char*)&p_stream->pes.i_codec );
diff --git a/modules/mux/mpeg/tsutil.c b/modules/mux/mpeg/tsutil.c
index 9414f82..21668a0 100644
--- a/modules/mux/mpeg/tsutil.c
+++ b/modules/mux/mpeg/tsutil.c
@@ -27,7 +27,7 @@
 #include "tsutil.h"
 
 void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, block_t *p_pes,
-              int i_pid, bool *pb_discontinuity, int *pi_continuity_counter )
+              uint16_t i_pid, bool *pb_discontinuity, uint8_t *pi_continuity_counter )
 {
     /* get PES total size */
     uint8_t *p_data = p_pes->p_buffer;
diff --git a/modules/mux/mpeg/tsutil.h b/modules/mux/mpeg/tsutil.h
index b49b8be..fa8b084 100644
--- a/modules/mux/mpeg/tsutil.h
+++ b/modules/mux/mpeg/tsutil.h
@@ -23,6 +23,6 @@
 typedef void(*PEStoTSCallback)(void *, block_t *);
 
 void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, block_t *p_pes,
-              int i_pid, bool *pb_discontinuity, int *pi_continuity_counter );
+              uint16_t i_pid, bool *pb_discontinuity, uint8_t *pi_continuity_counter );
 
 #endif



More information about the vlc-commits mailing list