]> git.sesse.net Git - vlc/commitdiff
* modules/mux/mpeg/ts.c: New --sout-ts-alignment option.
authorChristophe Massiot <massiot@videolan.org>
Mon, 20 Mar 2006 11:18:52 +0000 (11:18 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 20 Mar 2006 11:18:52 +0000 (11:18 +0000)
modules/mux/mpeg/ts.c

index 4bb4368b1d493bd9f4077b2d2dc898b3c10903c4..fd23d3788e2f41f37ccd15a9931832caa7357ec5 100644 (file)
@@ -101,8 +101,14 @@ static void    Close  ( vlc_object_t * );
 #define SDTDESC_TEXT N_("SDT Descriptors (requires --sout-ts-es-id-pid)")
 #define SDTDESC_LONGTEXT N_("Defines the descriptors of each SDT" )
 
-#define PID_TEXT N_("Set PID to id of ES")
-#define PID_LONGTEXT N_("set PID to id of es")
+#define PID_TEXT N_("Set PID to ID of ES")
+#define PID_LONGTEXT N_("Sets PID to the ID if the incoming ES. This is for " \
+  "use with --ts-es-id-pid, and allows to have the same PIDs in the input " \
+  "and output streams.")
+
+#define ALIGNMENT_TEXT N_("Data alignment")
+#define ALIGNMENT_LONGTEXT N_("Enforces alignment of all access units on " \
+  "PES boundaries. This is a waste of bandwidth.")
 
 #define SHAPING_TEXT N_("Shaping delay (ms)")
 #define SHAPING_LONGTEXT N_("If enabled, the TS muxer will cut the " \
@@ -186,6 +192,8 @@ vlc_module_begin();
 #ifdef HAVE_DVBPSI_SDT
     add_string( SOUT_CFG_PREFIX "sdtdesc", NULL, NULL, SDTDESC_TEXT, SDTDESC_LONGTEXT, VLC_TRUE );
 #endif
+    add_bool( SOUT_CFG_PREFIX "alignment", 0, NULL, ALIGNMENT_TEXT,
+              ALIGNMENT_LONGTEXT, VLC_TRUE );
 
     add_integer( SOUT_CFG_PREFIX "shaping", 200, NULL,SHAPING_TEXT,
                  SHAPING_LONGTEXT, VLC_TRUE );
@@ -220,7 +228,7 @@ static const char *ppsz_sout_options[] = {
     "pid-video", "pid-audio", "pid-spu", "pid-pmt", "tsid", "netid",
     "es-id-pid", "shaping", "pcr", "bmin", "bmax", "use-key-frames",
     "dts-delay", "csa-ck", "csa-pkt", "crypt-audio", "crypt-video",
-    "muxpmt", "sdtdesc", "program-pmt",
+    "muxpmt", "sdtdesc", "program-pmt", "alignment",
     NULL
 };
 
@@ -359,6 +367,7 @@ struct sout_mux_sys_t
     pmt_map_t       pmtmap[MAX_PMT_PID];
     int             i_pmt_program_number[MAX_PMT];
     sdt_desc_t      sdt_descriptors[MAX_PMT];
+    vlc_bool_t      b_data_alignment;
 
     int             i_mpeg4_streams;
 
@@ -609,6 +618,9 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_sdt = VLC_FALSE;
 #endif
 
+    var_Get( p_mux, SOUT_CFG_PREFIX "alignment", &val );
+    p_sys->b_data_alignment = val.b_bool;
+
     var_Get( p_mux, SOUT_CFG_PREFIX "program-pmt", &val );
     if( val.psz_string && *val.psz_string )
     {
@@ -1317,7 +1329,7 @@ static int Mux( sout_mux_t *p_mux )
                     }
                     b_ok = VLC_FALSE;
 
-                    if( p_stream == p_pcr_stream
+                    if( p_stream == p_pcr_stream || p_sys->b_data_alignment
                          || p_input->p_fmt->i_codec !=
                              VLC_FOURCC('m', 'p', 'g', 'a') )
                         p_data = block_FifoGet( p_input->p_fifo );