[vlc-commits] stream_output/select.c: explicitly select an ES

Jean-Paul Saman git at videolan.org
Tue Apr 19 11:32:14 CEST 2011


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Mon Apr  4 17:23:14 2011 +0200| [960d8fcd3a2526b3fc18b539344a89a3378aa277] | committer: Jean-Paul Saman

stream_output/select.c: explicitly select an ES

Add option to select stream_output module to enable an es by default

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

 modules/stream_out/select.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/select.c b/modules/stream_out/select.c
index fe4169d..d2c7e65 100644
--- a/modules/stream_out/select.c
+++ b/modules/stream_out/select.c
@@ -50,6 +50,10 @@ static void Close   ( vlc_object_t * );
 #define DISABLE_LONGTEXT N_( \
     "Disable ES id at startup." )
 
+#define ENABLE_TEXT N_("Enable ES id")
+#define ENABLE_LONGTEXT N_( \
+    "Only enable ES id at startup." )
+
 #define SOUT_CFG_PREFIX "sout-select-"
 
 vlc_module_begin ()
@@ -58,6 +62,7 @@ vlc_module_begin ()
     set_capability("sout stream", 50 )
     add_integer(SOUT_CFG_PREFIX "port", 5001, PORT_TEXT, PORT_LONGTEXT, true)
     add_integer(SOUT_CFG_PREFIX "disable", -1, DISABLE_TEXT, DISABLE_LONGTEXT, false)
+    add_integer(SOUT_CFG_PREFIX "enable", -1, ENABLE_TEXT, ENABLE_LONGTEXT, false)
     add_shortcut("select")
     set_callbacks(Open, Close)
 vlc_module_end ()
@@ -89,10 +94,11 @@ struct sout_stream_sys_t
 
     int i_fd;
     int i_id_disable;
+    int i_id_enable;
 };
 
 static const char *const ppsz_sout_options[] = {
-    "disable", "port", NULL
+    "enable", "disable", "port", NULL
 };
 
 /*****************************************************************************
@@ -125,6 +131,7 @@ static int Open(vlc_object_t *p_this)
         return VLC_EGENERIC;
     }
     p_sys->i_id_disable = var_GetInteger(p_stream, SOUT_CFG_PREFIX "disable");
+    p_sys->i_id_enable = var_GetInteger(p_stream, SOUT_CFG_PREFIX "enable");
 
     p_sys->pp_es = NULL;
     p_sys->i_es_num = 0;
@@ -254,7 +261,10 @@ static sout_stream_id_t *Add(sout_stream_t *p_stream, es_format_t *p_fmt)
     p_es->fmt = *p_fmt;
     p_es->id = NULL;
     p_es->b_error = false;
-    p_es->b_enabled = (p_es->fmt.i_id == p_sys->i_id_disable) ? false : true;
+    if (p_sys->i_id_disable >= -1)
+        p_es->b_enabled = (p_es->fmt.i_id == p_sys->i_id_disable) ? false : true;
+    else if (p_sys->i_id_enable >= -1)
+        p_es->b_enabled = (p_es->fmt.i_id == p_sys->i_id_enable) ? true: false;
 
     vlc_mutex_lock(&p_sys->es_lock);
     TAB_APPEND(p_sys->i_es_num, p_sys->pp_es, p_es);



More information about the vlc-commits mailing list