[vlc-commits] input/input: simplify LoadSubtitles flags use

Thomas Guillem git at videolan.org
Thu May 19 15:57:27 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 25 11:38:00 2016 +0100| [897352483edbffb5c47749c9ede72f3a94d47a36] | committer: Thomas Guillem

input/input: simplify LoadSubtitles flags use

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

 src/input/input.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 601c62a..be2380d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -968,14 +968,12 @@ static void LoadSubtitles( input_thread_t *p_input )
         var_SetInteger( p_input, "spu-delay", (mtime_t)i_delay * 100000 );
 
     /* Look for and add subtitle files */
-    unsigned i_flags = SUB_FORCED;
 
     char *psz_subtitle = var_GetNonEmptyString( p_input, "sub-file" );
     if( psz_subtitle != NULL )
     {
         msg_Dbg( p_input, "forced subtitle: %s", psz_subtitle );
-        input_SubtitleFileAdd( p_input, psz_subtitle, i_flags, true );
-        i_flags = SUB_NOFLAG;
+        input_SubtitleFileAdd( p_input, psz_subtitle, SUB_FORCED, true );
     }
 
     if( var_GetBool( p_input, "sub-autodetect-file" ) )
@@ -1010,9 +1008,7 @@ static void LoadSubtitles( input_thread_t *p_input )
         for( int i = 0; i < i_slaves && pp_slaves[i] != NULL; i++ )
         {
             const char *psz_uri = pp_slaves[i]->psz_uri;
-            i_flags |= SUB_CANFAIL;
-            input_SubtitleAdd( p_input, psz_uri, i_flags );
-            i_flags = SUB_NOFLAG;
+            input_SubtitleAdd( p_input, psz_uri, SUB_CANFAIL );
 
             input_item_slave_Delete( pp_slaves[i] );
         }
@@ -1049,9 +1045,8 @@ static void LoadSubtitles( input_thread_t *p_input )
         {
             var_SetString( p_input, "sub-description", a->psz_description ? a->psz_description : "");
 
-            input_SubtitleAdd( p_input, psz_mrl, i_flags );
+            input_SubtitleAdd( p_input, psz_mrl, SUB_NOFLAG );
 
-            i_flags = SUB_NOFLAG;
             free( psz_mrl );
         }
         vlc_input_attachment_Delete( a );



More information about the vlc-commits mailing list