[vlc-commits] input: fix initial "sub-delay" conversion to spu_delay

Thomas Guillem git at videolan.org
Thu Oct 18 13:12:48 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Oct 17 09:54:41 2018 +0200| [5f24f796a4a3b3d8b9478b4db9dc236415846a16] | committer: Thomas Guillem

input: fix initial "sub-delay" conversion to spu_delay

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

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

diff --git a/src/input/input.c b/src/input/input.c
index cd8e34db44..9823e72975 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -998,6 +998,8 @@ static bool SlaveExists( input_item_slave_t **pp_slaves, int i_slaves,
 
 static void SetSubtitlesOptions( input_thread_t *p_input )
 {
+    input_thread_private_t *priv = input_priv(p_input);
+
     /* Get fps and set it if not already set */
     const float f_fps = input_priv(p_input)->master->f_fps;
     if( f_fps > 1.f )
@@ -1007,9 +1009,13 @@ static void SetSubtitlesOptions( input_thread_t *p_input )
             var_SetFloat( p_input, "sub-fps", f_fps );
     }
 
-    const int i_delay = var_CreateGetInteger( p_input, "sub-delay" );
-    if( i_delay != 0 )
-        var_SetInteger( p_input, "spu-delay", vlc_tick_from_samples(i_delay, 10) );
+    int64_t sub_delay = var_InheritInteger( p_input, "sub-delay" );
+    if( sub_delay != 0 )
+    {
+        priv->i_spu_delay = vlc_tick_from_samples(sub_delay, 10);
+        input_SendEventSubtitleDelay( p_input, priv->i_spu_delay );
+        /* UpdatePtsDelay will be called next by InitPrograms */
+    }
 }
 
 static void GetVarSlaves( input_thread_t *p_input,



More information about the vlc-commits mailing list