[vlc-commits] input: avoid non-portable int to pointer conversion

Rémi Denis-Courmont git at videolan.org
Tue Nov 20 21:34:04 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 20 20:12:44 2018 +0200| [3d2a75c315292c01c3efe1fe992616c8838f1ce3] | committer: Rémi Denis-Courmont

input: avoid non-portable int to pointer conversion

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

 src/input/var.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/input/var.c b/src/input/var.c
index 6038c883c1..acf2517ad8 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -598,8 +598,7 @@ static void input_LegacyVarNavigation( input_thread_t *p_input )
         sprintf( title, "title %2u", i );
         var_Destroy( p_input, title );
         var_Create( p_input, title, VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-        var_AddCallback( p_input, title,
-                         NavigationCallback, (void *)(intptr_t)i );
+        var_AddCallback( p_input, title, NavigationCallback, NULL );
 
         char psz_length[MSTRTIME_MAX_SIZE + sizeof(" []")];
         if( input_priv(p_input)->title[i]->i_length > 0 )
@@ -1009,7 +1008,7 @@ static int NavigationCallback( vlc_object_t *p_this, char const *psz_cmd,
     VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
 
     /* Issue a title change */
-    val.i_int = (intptr_t)p_data;
+    sscanf(psz_cmd, "title %"SCNu64, &val.i_int);
     input_ControlPushHelper( p_input, INPUT_CONTROL_SET_TITLE, &val );
 
     var_Change( p_input, "title", VLC_VAR_SETVALUE, val );
@@ -1018,7 +1017,7 @@ static int NavigationCallback( vlc_object_t *p_this, char const *psz_cmd,
     input_ControlPushHelper( p_input, INPUT_CONTROL_SET_SEEKPOINT, &newval );
 
     var_Change( p_input, "chapter", VLC_VAR_SETVALUE, newval );
-
+    (void) p_data;
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list