[vlc-devel] commit: Privatized p_input->i_time. (Laurent Aimar )
git version control
git at videolan.org
Sat Jan 17 12:44:07 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Jan 16 21:34:35 2009 +0100| [93acbebb6c5f4db42eb465a0908fe0275048a309] | committer: Laurent Aimar
Privatized p_input->i_time.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93acbebb6c5f4db42eb465a0908fe0275048a309
---
include/vlc_input.h | 1 -
src/input/input.c | 6 +++---
src/input/input_internal.h | 3 ++-
src/text/strings.c | 9 +++++----
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/vlc_input.h b/include/vlc_input.h
index eeb0c0e..8cc5da2 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -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 */
diff --git a/src/input/input.c b/src/input/input.c
index 9680497..afe44ea 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -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 ) )
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index ff409ec..7a4bf74 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -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;
diff --git a/src/text/strings.c b/src/text/strings.c
index 0c63154..b76d14c 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -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
{
More information about the vlc-devel
mailing list