Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
79786424
Commit
79786424
authored
Aug 03, 2004
by
Laurent Aimar
Browse files
* input.c: fixed total length in playlist.
parent
196a0c98
Changes
1
Show whitespace changes
Inline
Side-by-side
src/input/input.c
View file @
79786424
...
@@ -56,6 +56,8 @@ static vlc_bool_t Control( input_thread_t *, int, vlc_value_t );
...
@@ -56,6 +56,8 @@ static vlc_bool_t Control( input_thread_t *, int, vlc_value_t );
static
void
UpdateFromAccess
(
input_thread_t
*
);
static
void
UpdateFromAccess
(
input_thread_t
*
);
static
void
UpdateFromDemux
(
input_thread_t
*
);
static
void
UpdateFromDemux
(
input_thread_t
*
);
static
void
UpdateItemLength
(
input_thread_t
*
,
int64_t
i_length
);
static
void
ParseOption
(
input_thread_t
*
p_input
,
const
char
*
psz_option
);
static
void
ParseOption
(
input_thread_t
*
p_input
,
const
char
*
psz_option
);
static
void
DecodeUrl
(
char
*
);
static
void
DecodeUrl
(
char
*
);
...
@@ -450,15 +452,7 @@ static int Run( input_thread_t *p_input )
...
@@ -450,15 +452,7 @@ static int Run( input_thread_t *p_input )
if
(
old_val
.
i_time
!=
val
.
i_time
)
if
(
old_val
.
i_time
!=
val
.
i_time
)
{
{
char
psz_buffer
[
MSTRTIME_MAX_SIZE
];
UpdateItemLength
(
p_input
,
i_length
);
vlc_mutex_lock
(
&
p_input
->
input
.
p_item
->
lock
);
p_input
->
input
.
p_item
->
i_duration
=
i_length
;
vlc_mutex_unlock
(
&
p_input
->
input
.
p_item
->
lock
);
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"General"
),
_
(
"Duration"
),
msecstotimestr
(
psz_buffer
,
i_length
/
1000
)
);
}
}
}
}
...
@@ -563,7 +557,8 @@ static int Init( input_thread_t * p_input )
...
@@ -563,7 +557,8 @@ static int Init( input_thread_t * p_input )
&
val
.
i_time
)
&&
val
.
i_time
>
0
)
&
val
.
i_time
)
&&
val
.
i_time
>
0
)
{
{
var_Change
(
p_input
,
"length"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
var_Change
(
p_input
,
"length"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
/* TODO update playlist meta data */
UpdateItemLength
(
p_input
,
val
.
i_time
);
}
}
/* Start time*/
/* Start time*/
/* Set start time */
/* Set start time */
...
@@ -1401,6 +1396,21 @@ static void UpdateFromAccess( input_thread_t *p_input )
...
@@ -1401,6 +1396,21 @@ static void UpdateFromAccess( input_thread_t *p_input )
p_access
->
info
.
i_update
&=
~
INPUT_UPDATE_SIZE
;
p_access
->
info
.
i_update
&=
~
INPUT_UPDATE_SIZE
;
}
}
/*****************************************************************************
* UpdateItemLength:
*****************************************************************************/
static
void
UpdateItemLength
(
input_thread_t
*
p_input
,
int64_t
i_length
)
{
char
psz_buffer
[
MSTRTIME_MAX_SIZE
];
vlc_mutex_lock
(
&
p_input
->
input
.
p_item
->
lock
);
p_input
->
input
.
p_item
->
i_duration
=
i_length
;
vlc_mutex_unlock
(
&
p_input
->
input
.
p_item
->
lock
);
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"General"
),
_
(
"Duration"
),
msecstotimestr
(
psz_buffer
,
i_length
/
1000
)
);
}
/*****************************************************************************
/*****************************************************************************
* InputSourceNew:
* InputSourceNew:
*****************************************************************************/
*****************************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment