[vlc-commits] input: subtitle: no auto SPU slave for TS

Francois Cartegnie git at videolan.org
Wed Feb 27 14:50:52 CET 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Feb 27 14:08:32 2019 +0100| [691758797b451336b5c4a1720d2ad1802c4fe219] | committer: Francois Cartegnie

input: subtitle: no auto SPU slave for TS

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

 src/input/subtitles.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/input/subtitles.c b/src/input/subtitles.c
index 25ebb52087..fa31e41774 100644
--- a/src/input/subtitles.c
+++ b/src/input/subtitles.c
@@ -44,6 +44,9 @@
  * The possible extensions for subtitle files we support
  */
 static const char *const sub_exts[] = { SLAVE_SPU_EXTENSIONS, "" };
+/* As core can't handle non default program hijacking by slaves,
+ * we need to disable any SPU slave for those masters for now */
+static const char *const noslave_exts[] = { "m2ts", "ts" };
 
 static void strcpy_trim( char *d, const char *s )
 {
@@ -229,6 +232,19 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
     if( !psz_fname )
         return VLC_EGENERIC;
 
+    const char *ext = strrchr( psz_fname, '.' );
+    if( ext != NULL )
+    {
+        for( size_t i=0; i<ARRAY_SIZE(noslave_exts); i++ )
+        {
+            if( !strcasecmp( &ext[1], noslave_exts[i] ) )
+            {
+                free( psz_fname );
+                return VLC_EGENERIC;
+            }
+        }
+    }
+
     /* extract filename & dirname from psz_fname */
     char *f_dir = strdup( psz_fname );
     if( f_dir == 0 )



More information about the vlc-commits mailing list