[vlc-commits] input: fix `input-slave` option for subtitles

Alaric Senat git at videolan.org
Thu Apr 1 11:44:55 UTC 2021


vlc/vlc-3.0 | branch: master | Alaric Senat <dev.asenat at posteo.net> | Tue Mar 30 15:29:53 2021 +0200| [8fe00499352f149f2fd6d6e1e065a3fca1a6b163] | committer: Thomas Guillem

input: fix `input-slave` option for subtitles

Since c34d719f, all files passed by the option `input-slave` were set as
audio tracks no matter what.
Theses changes force subtitle demux on files with a known spu extension.

Fixes #25549

Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit 08a3c76355b0ba9eb6658a730cc6c763775b63b6)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=8fe00499352f149f2fd6d6e1e065a3fca1a6b163
---

 src/input/input.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index 1b8a2eb83d..49eeab3b0e 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1058,8 +1058,17 @@ static void GetVarSlaves( input_thread_t *p_input,
         if( uri == NULL )
             continue;
 
+        enum slave_type i_type;
+        if ( !input_item_slave_GetType(uri, &i_type) )
+        {
+            msg_Warn( p_input,
+                     "Can't deduce slave type of `%s\" with file extension.",
+                     uri );
+            i_type = SLAVE_TYPE_AUDIO;
+        }
         input_item_slave_t *p_slave =
-            input_item_slave_New( uri, SLAVE_TYPE_AUDIO, SLAVE_PRIORITY_USER );
+            input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER );
+
         free( uri );
 
         if( unlikely( p_slave == NULL ) )



More information about the vlc-commits mailing list