[vlc-devel] [RFC PATCHv2 18/18] es_out: deprecate "cat-track-id" options

Thomas Guillem thomas at gllm.fr
Tue Feb 18 17:11:31 CET 2020


video-track, audio-track, and sub-track should be used instead.
---
 src/input/es_out.c  | 17 ++++-------------
 src/input/var.c     |  7 -------
 src/libvlc-module.c | 25 +++----------------------
 3 files changed, 7 insertions(+), 42 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index caafe641411..f2dd8a88023 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -162,7 +162,6 @@ typedef struct
 
     /* Parameters used for es selection */
     bool        b_autoselect; /* if we want to select an es when no user prefs */
-    int         i_id;       /* es id as set by es fmt.id */
     int         i_demux_id; /* same as previous, demuxer set default value */
     int         i_channel;  /* es number in creation order */
     char        *str_id; /* stream id to select */
@@ -453,7 +452,6 @@ static void EsOutPropsInit( es_out_es_props_t *p_props,
                             bool autoselect,
                             input_thread_t *p_input,
                             enum es_out_policy_e e_default_policy,
-                            const char *psz_trackidvar,
                             const char *psz_trackvar,
                             const char *psz_langvar,
                             const char *psz_debug )
@@ -461,7 +459,6 @@ static void EsOutPropsInit( es_out_es_props_t *p_props,
     p_props->e_policy = e_default_policy;
     p_props->i_count = 0;
     p_props->b_autoselect = autoselect;
-    p_props->i_id = (psz_trackidvar) ? var_GetInteger( p_input, psz_trackidvar ): -1;
     p_props->str_id = psz_trackvar ? var_GetNonEmptyString( p_input, psz_trackvar ): NULL;
     p_props->i_demux_id = -1;
     p_props->p_main_es = NULL;
@@ -512,11 +509,11 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, float rate )
 
     /* */
     EsOutPropsInit( &p_sys->video, true, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
-                    "video-track-id", "video-track", NULL, NULL );
+                    "video-track", NULL, NULL );
     EsOutPropsInit( &p_sys->audio, true, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
-                    "audio-track-id", "audio-track", "audio-language", "audio" );
+                    "audio-track", "audio-language", "audio" );
     EsOutPropsInit( &p_sys->sub,  false, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
-                    "sub-track-id", "sub-track", "sub-language", "sub" );
+                    "sub-track", "sub-language", "sub" );
 
     p_sys->i_group_id = var_GetInteger( p_input, "program" );
 
@@ -2493,13 +2490,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
             return;
 
         /* user designated by ID ES have higher prio than everything */
-        if ( p_esprops->i_id >= 0 )
-        {
-            if( es->fmt.i_id == p_esprops->i_id )
-                wanted_es = es;
-        }
-        /* then per pos */
-        else if( p_esprops->str_id )
+        if( p_esprops->str_id )
         {
             if( strcmp( p_esprops->str_id, es->id.str_id ) == 0 )
                 wanted_es = es;
diff --git a/src/input/var.c b/src/input/var.c
index 22d7ff24086..973d218622a 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -57,13 +57,6 @@ void input_ConfigVarInit ( input_thread_t *p_input )
         var_Create( p_input, "menu-language",
                     VLC_VAR_STRING|VLC_VAR_DOINHERIT );
 
-        var_Create( p_input, "video-track-id",
-                    VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
-        var_Create( p_input, "audio-track-id",
-                    VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
-        var_Create( p_input, "sub-track-id",
-                    VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
-
         var_Create( p_input, "sub-file", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
         var_Create( p_input, "sub-autodetect-file", VLC_VAR_BOOL |
                     VLC_VAR_DOINHERIT );
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index ff711c0ce9e..e587d3ba522 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -628,19 +628,6 @@ static const char *const ppsz_clock_descriptions[] =
     "Language of the menus you want to use with DVD/BluRay " \
     "(comma separated, two or three letters country code, you may use 'any' as a fallback).")
 
-/// \todo Document how to find it
-#define INPUT_VIDEOTRACK_ID_TEXT N_("Video track ID")
-#define INPUT_VIDEOTRACK_ID_LONGTEXT N_( \
-    "Stream ID of the video track to use.")
-
-#define INPUT_AUDIOTRACK_ID_TEXT N_("Audio track ID")
-#define INPUT_AUDIOTRACK_ID_LONGTEXT N_( \
-    "Stream ID of the audio track to use.")
-
-#define INPUT_SUBTRACK_ID_TEXT N_("Subtitle track ID")
-#define INPUT_SUBTRACK_ID_LONGTEXT N_( \
-    "Stream ID of the subtitle track to use.")
-
 #define INPUT_CAPTIONS_TEXT N_(N_("Preferred Closed Captions decoder"))
 static const int pi_captions[] = { 608, 708 };
 static const char *const ppsz_captions[] = { "EIA/CEA 608", "CEA 708" };
@@ -1845,15 +1832,9 @@ vlc_module_begin ()
                  INPUT_MENUTRACK_LANG_TEXT, INPUT_MENUTRACK_LANG_LONGTEXT,
                   false )
         change_safe ()
-    add_integer( "video-track-id", -1, INPUT_VIDEOTRACK_ID_TEXT,
-                 INPUT_VIDEOTRACK_ID_LONGTEXT, true )
-        change_safe ()
-    add_integer( "audio-track-id", -1, INPUT_AUDIOTRACK_ID_TEXT,
-                 INPUT_AUDIOTRACK_ID_LONGTEXT, true )
-        change_safe ()
-    add_integer( "sub-track-id", -1,
-                 INPUT_SUBTRACK_ID_TEXT, INPUT_SUBTRACK_ID_LONGTEXT, true )
-        change_safe ()
+    add_obsolete_integer( "video-track-id" )
+    add_obsolete_integer( "audio-track-id" )
+    add_obsolete_integer( "sub-track-id" )
     add_integer( "captions", 608,
                  INPUT_CAPTIONS_TEXT, INPUT_CAPTIONS_TEXT, true )
         change_integer_list( pi_captions, ppsz_captions )
-- 
2.20.1



More information about the vlc-devel mailing list