[vlc-commits] input: handle "sub-fps" callback (legacy)

Thomas Guillem git at videolan.org
Thu Oct 18 12:57:35 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Oct 17 14:44:03 2018 +0200| [de4a0c75618e49af33d5ce98ff6e7bf90515e101] | committer: Thomas Guillem

input: handle "sub-fps" callback (legacy)

Remainder: all these legacy variable callbacks will be removed when the new
player is used.

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

 src/input/var.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/input/var.c b/src/input/var.c
index b4264d7938..895e373b23 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -76,6 +76,9 @@ static int RecordCallback( vlc_object_t *p_this, char const *psz_cmd,
 static int FrameNextCallback( vlc_object_t *p_this, char const *psz_cmd,
                               vlc_value_t oldval, vlc_value_t newval,
                               void *p_data );
+static int SubFpsCallback( vlc_object_t *p_this, char const *psz_cmd,
+                           vlc_value_t oldval, vlc_value_t newval,
+                           void *p_data );
 static void input_LegacyVarTitle( input_thread_t *p_input, int i_title );
 static void input_LegacyVarNavigation( input_thread_t *p_input );
 
@@ -110,6 +113,7 @@ static const vlc_input_callback_t p_input_callbacks[] =
     CALLBACK( "spu-es", EsSpuCallback ),
     CALLBACK( "record", RecordCallback ),
     CALLBACK( "frame-next", FrameNextCallback ),
+    CALLBACK( "sub-fps", SubFpsCallback ),
 
     CALLBACK( NULL, NULL )
 };
@@ -533,6 +537,7 @@ void input_LegacyVarInit ( input_thread_t *p_input )
 
     /* Special "intf-event" variable. */
     var_Create( p_input, "intf-event", VLC_VAR_INTEGER );
+    var_Create( p_input, "sub-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
 
     /* Add all callbacks
      * XXX we put callback only in non preparsing mode. We need to create the variable
@@ -1113,3 +1118,15 @@ static int FrameNextCallback( vlc_object_t *p_this, char const *psz_cmd,
     return VLC_SUCCESS;
 }
 
+static int SubFpsCallback( vlc_object_t *p_this, char const *psz_cmd,
+                           vlc_value_t oldval, vlc_value_t newval,
+                           void *p_data )
+{
+    input_thread_t *p_input = (input_thread_t*)p_this;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
+    VLC_UNUSED(newval);
+
+    input_ControlPushHelper( p_input, INPUT_CONTROL_SET_SUBS_FPS, &newval );
+
+    return VLC_SUCCESS;
+}



More information about the vlc-commits mailing list