[vlc-devel] commit: Correctly update "title %2i" variable. (Laurent Aimar )

git version control git at videolan.org
Tue Jun 9 20:17:36 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Jun  9 20:15:03 2009 +0200| [1a912ab730421717b01bf05d0bd5cf8da1da4745] | committer: Laurent Aimar 

Correctly update "title %2i" variable.

It is a partial revert of [a8c9c25d2c137daf94292dcbbf4e889c6de0d6e6]

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

 src/input/event.c |    8 +++++++-
 src/input/var.c   |   10 ----------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/input/event.c b/src/input/event.c
index 6703dfe..308842c 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -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 );
 }
 
diff --git a/src/input/var.c b/src/input/var.c
index 38aac2d..955ca8e 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -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;




More information about the vlc-devel mailing list