]> git.sesse.net Git - vlc/commitdiff
Privatized p_input->i_time.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 16 Jan 2009 20:34:35 +0000 (21:34 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 17 Jan 2009 11:35:48 +0000 (12:35 +0100)
include/vlc_input.h
src/input/input.c
src/input/input_internal.h
src/text/strings.c

index eeb0c0eaae17d4818ccfbd94f828679f47fc5dfd..8cc5da2b547be15b013fcf8abb1dd0d85c67122d 100644 (file)
@@ -413,7 +413,6 @@ struct input_thread_t
 
     int i_state;
     bool b_can_pace_control;
-    int64_t     i_time;     /* Current time */
 
     /* All other data is input_thread is PRIVATE. You can't access it
      * outside of src/input */
index 968049754af8adee463da7119d11fe187d47d5cf..afe44eae154baf2c210bea765723d88abe650d02 100644 (file)
@@ -167,7 +167,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
     p_input->b_eof = false;
     p_input->b_can_pace_control = true;
     p_input->p->i_start = 0;
-    p_input->i_time     = 0;
+    p_input->p->i_time  = 0;
     p_input->p->i_stop  = 0;
     p_input->p->i_run   = 0;
     p_input->p->i_title = 0;
@@ -568,7 +568,7 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, mtime_t *p
 
     *pb_changed = false;
 
-    if( ( p_input->p->i_stop > 0 && p_input->i_time >= p_input->p->i_stop ) ||
+    if( ( p_input->p->i_stop > 0 && p_input->p->i_time >= p_input->p->i_stop ) ||
         ( p_input->p->i_run > 0 && *pi_start_mdate+p_input->p->i_run < mdate() ) )
         i_ret = 0; /* EOF */
     else
@@ -682,7 +682,7 @@ static void MainLoopInterface( input_thread_t *p_input )
     if( demux_Control( p_input->p->input.p_demux,
                        DEMUX_GET_TIME, &i_time ) )
         i_time = 0;
-    p_input->i_time = i_time;
+    p_input->p->i_time = i_time;
 
     if( demux_Control( p_input->p->input.p_demux,
                        DEMUX_GET_LENGTH, &i_length ) )
index ff409ec6997d12387989abf4fffd037a17f84eaa..7a4bf746010b742dd751b6c80fe0c87699595ec1 100644 (file)
@@ -87,10 +87,11 @@ struct input_thread_private_t
     int         i_rate;
     bool        b_recording;
 
-    /* Playtime configuration */
+    /* Playtime configuration and state */
     int64_t     i_start;    /* :start-time,0 by default */
     int64_t     i_stop;     /* :stop-time, 0 if none */
     int64_t     i_run;      /* :run-time, 0 if none */
+    int64_t     i_time;     /* Current time */
 
     /* Title infos FIXME multi-input (not easy) ? */
     int          i_title;
index 0c63154a99b3f4fc02fff8b3189d1cc2aa502c26..b76d14c46fe181b301ba4421e9c9ca63b9c06207 100644 (file)
@@ -870,7 +870,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
                     if( p_item && p_input )
                     {
                         mtime_t i_duration = input_item_GetDuration( p_item );
-                        int64_t i_time = p_input->i_time;
+                        int64_t i_time = var_GetInteger( p_input, "time" );
                         sprintf( buf, "%02d:%02d:%02d",
                      (int)( ( i_duration - i_time ) / 3600000000 ),
                      (int)( ( ( i_duration - i_time ) / 60000000 ) % 60 ),
@@ -938,10 +938,11 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
                 case 'T':
                     if( p_input )
                     {
+                        int64_t i_time = var_GetInteger( p_input, "time" );
                         sprintf( buf, "%02d:%02d:%02d",
-                            (int)( p_input->i_time / ( 3600000000 ) ),
-                            (int)( ( p_input->i_time / ( 60000000 ) ) % 60 ),
-                            (int)( ( p_input->i_time / 1000000 ) % 60 ) );
+                            (int)( i_time / ( 3600000000 ) ),
+                            (int)( ( i_time / ( 60000000 ) ) % 60 ),
+                            (int)( ( i_time / 1000000 ) % 60 ) );
                     }
                     else
                     {