[vlc-devel] [PATCH] input: automatically select subtitle attachments

Salah-Eddin Shaban salah at videolan.org
Mon Oct 30 13:07:47 CET 2017


If no sub track has already been selected via sub-file or autodetection.

Close #18897
---
 src/input/input.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index f03448445b..aa55dd7f8f 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1194,8 +1194,11 @@ static void LoadSlaves( input_thread_t *p_input )
         {
             var_SetString( p_input, "sub-description", a->psz_description ? a->psz_description : "");
 
-            input_SlaveSourceAdd( p_input, SLAVE_TYPE_SPU, psz_mrl,
-                                  SLAVE_ADD_NOFLAG );
+            if( input_SlaveSourceAdd( p_input, SLAVE_TYPE_SPU, psz_mrl,
+                                      p_forced[ SLAVE_TYPE_SPU ] ?
+                                      SLAVE_ADD_NOFLAG : SLAVE_ADD_FORCED ) == VLC_SUCCESS )
+                p_forced[ SLAVE_TYPE_SPU ] = true;
+
             free( psz_mrl );
             /* Don't update item slaves for attachements */
         }
-- 
2.12.3



More information about the vlc-devel mailing list