[vlc-devel] [PATCH 5/5] input: handle "sub-fps" callback (legacy)

Thomas Guillem thomas at gllm.fr
Wed Oct 17 15:32:59 CEST 2018


Remainder: all these legacy variable callbacks will be removed when the new
player is used.
---
 src/input/var.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/input/var.c b/src/input/var.c
index 130636bf98..d5b3195be7 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 )
 };
@@ -535,6 +539,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
@@ -1115,3 +1120,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_SLAVE_FPS, &newval );
+
+    return VLC_SUCCESS;
+}
-- 
2.19.1



More information about the vlc-devel mailing list