]> git.sesse.net Git - vlc/commitdiff
Correctly update "title %2i" variable.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 9 Jun 2009 18:15:03 +0000 (20:15 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 9 Jun 2009 18:15:03 +0000 (20:15 +0200)
It is a partial revert of [a8c9c25d2c137daf94292dcbbf4e889c6de0d6e6]

src/input/event.c
src/input/var.c

index 6703dfed395c64a1bbc418aed0767fa061a65521..308842c400c230ee60b0c439f5753ca7b27cfe05 100644 (file)
@@ -149,10 +149,16 @@ void input_SendEventSeekpoint( input_thread_t *p_input, int i_title, int i_seekp
 {
        vlc_value_t val;
 
-       VLC_UNUSED( i_title );
+    /* "chapter" */
        val.i_int = i_seekpoint;
        var_Change( p_input, "chapter", VLC_VAR_SETVALUE, &val, NULL );
 
+    /* "title %2i" */
+    char psz_title[10];
+    snprintf( psz_title, sizeof(psz_title), "title %2i", i_title );
+    var_Change( p_input, psz_title, VLC_VAR_SETVALUE, &val, NULL );
+
+    /* */
     Trigger( p_input, INPUT_EVENT_CHAPTER );
 }
 
index 38aac2d56f5344796a1b6da2fb257ff000e6896b..955ca8e9fe492e89f80d9aa4a40b9dacf6c75692 100644 (file)
@@ -711,16 +711,6 @@ static int SeekpointCallback( vlc_object_t *p_this, char const *psz_cmd,
     else
     {
         input_ControlPush( p_input, INPUT_CONTROL_SET_SEEKPOINT, &newval );
-        val.i_int = newval.i_int;
-    }
-
-    /* Actualize "title %2i" variable */
-    if( val.i_int >= 0 && val.i_int < count.i_int )
-    {
-        int i_title = var_GetInteger( p_input, "title" );
-        char psz_titlevar[10] = {0};
-        snprintf( psz_titlevar, 10, "title %2i", i_title );
-        var_Change( p_input, psz_titlevar, VLC_VAR_SETVALUE, &val, NULL );
     }
 
     return VLC_SUCCESS;