[vlc-devel] [PATCH 03/14] es_out: add a new ES policy: auto

Thomas Guillem thomas at gllm.fr
Fri Feb 21 16:59:34 CET 2020


This policy, used for sub and video behave as exclusive by default but switch
to simultaneous if more than one tracks is specifically requested by the user.
---
 include/vlc_es_out.h | 3 +++
 src/input/es_out.c   | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h
index c5424d5438a..7831479c054 100644
--- a/include/vlc_es_out.h
+++ b/include/vlc_es_out.h
@@ -124,6 +124,9 @@ enum es_out_policy_e
 {
     ES_OUT_ES_POLICY_EXCLUSIVE = 0,/* Enforces single ES selection only */
     ES_OUT_ES_POLICY_SIMULTANEOUS, /* Allows multiple ES per cat */
+    /* Exclusive by default, and simultanous if specificaly requested more than
+     * one track at once */
+    ES_OUT_ES_POLICY_AUTO,
 };
 
 typedef struct es_out_ctx_t es_out_ctx_t;
diff --git a/src/input/es_out.c b/src/input/es_out.c
index f782eb61079..e7a1c7cb441 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -510,11 +510,11 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, float rate )
     vlc_list_init(&p_sys->es_slaves);
 
     /* */
-    EsOutPropsInit( &p_sys->video, true, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
+    EsOutPropsInit( &p_sys->video, true, p_input, ES_OUT_ES_POLICY_AUTO,
                     "video-track-id", "video-track", NULL, NULL );
     EsOutPropsInit( &p_sys->audio, true, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
                     "audio-track-id", "audio-track", "audio-language", "audio" );
-    EsOutPropsInit( &p_sys->sub,  false, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
+    EsOutPropsInit( &p_sys->sub,  false, p_input, ES_OUT_ES_POLICY_AUTO,
                     "sub-track-id", "sub-track", "sub-language", "sub" );
 
     p_sys->i_group_id = var_GetInteger( p_input, "program" );
-- 
2.20.1



More information about the vlc-devel mailing list