[vlc-commits] mux: ts: simplify bih params

Francois Cartegnie git at videolan.org
Mon Apr 25 14:41:18 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Apr 25 11:24:41 2016 +0200| [999b7e0a975253fb51a90753c1dd8182b148dcd5] | committer: Francois Cartegnie

mux: ts: simplify bih params

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

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

diff --git a/modules/mux/mpeg/streams.h b/modules/mux/mpeg/streams.h
index a066337..70cc3fe 100644
--- a/modules/mux/mpeg/streams.h
+++ b/modules/mux/mpeg/streams.h
@@ -36,9 +36,7 @@ typedef struct
     int             i_stream_type;
     int             i_stream_id;
 
-    /* to be used for carriege of DIV3 */
-    vlc_fourcc_t    i_bih_codec;
-    int             i_bih_width, i_bih_height;
+    int             i_width, i_height;
 
     /* Specific to mpeg4 in mpeg2ts */
     int             i_es_id;
diff --git a/modules/mux/mpeg/tables.c b/modules/mux/mpeg/tables.c
index 0ddd4b0..4cd2142 100644
--- a/modules/mux/mpeg/tables.c
+++ b/modules/mux/mpeg/tables.c
@@ -341,11 +341,11 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
             int i_extra = __MIN( p_stream->pes->i_extra, 502 );
 
             /* private DIV3 descripor */
-            memcpy( &data[0], &p_stream->pes->i_bih_codec, 4 );
-            data[4] = ( p_stream->pes->i_bih_width >> 8 )&0xff;
-            data[5] = ( p_stream->pes->i_bih_width      )&0xff;
-            data[6] = ( p_stream->pes->i_bih_height>> 8 )&0xff;
-            data[7] = ( p_stream->pes->i_bih_height     )&0xff;
+            memcpy( &data[0], &p_stream->pes->i_codec, 4 );
+            data[4] = ( p_stream->pes->i_width >> 8 )&0xff;
+            data[5] = ( p_stream->pes->i_width      )&0xff;
+            data[6] = ( p_stream->pes->i_height>> 8 )&0xff;
+            data[7] = ( p_stream->pes->i_height     )&0xff;
             data[8] = ( i_extra >> 8 )&0xff;
             data[9] = ( i_extra      )&0xff;
             if( i_extra > 0 )
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index 342950f..b20a40c 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -884,6 +884,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
         p_stream->ts.i_pid = AllocatePID( p_mux, p_input->p_fmt->i_cat );
 
     p_stream->pes.i_codec = p_input->p_fmt->i_codec;
+    if( p_input->p_fmt->i_cat == VIDEO_ES )
+    {
+        p_stream->pes.i_width = p_input->fmt.video.i_width;
+        p_stream->pes.i_height = p_input->fmt.video.i_height;
+    }
 
     p_stream->pes.i_stream_type = -1;
     switch( p_input->p_fmt->i_codec )
@@ -922,9 +927,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     case VLC_CODEC_MJPG:
         p_stream->pes.i_stream_type = 0xa0; /* private */
         p_stream->pes.i_stream_id = 0xa0;   /* beurk */
-        p_stream->pes.i_bih_codec  = p_input->p_fmt->i_codec;
-        p_stream->pes.i_bih_width  = p_input->p_fmt->video.i_width;
-        p_stream->pes.i_bih_height = p_input->p_fmt->video.i_height;
         break;
     case VLC_CODEC_DIRAC:
         /* stream_id makes use of stream_id_extension */



More information about the vlc-commits mailing list