Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
476ce3ee
Commit
476ce3ee
authored
Sep 24, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use provided system time instead of mdate().
parent
1c34c14b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/input/clock.c
src/input/clock.c
+5
-5
No files found.
src/input/clock.c
View file @
476ce3ee
...
@@ -90,15 +90,15 @@ static mtime_t ClockToSysdate( input_clock_t *cl, mtime_t i_clock )
...
@@ -90,15 +90,15 @@ static mtime_t ClockToSysdate( input_clock_t *cl, mtime_t i_clock )
}
}
/*****************************************************************************
/*****************************************************************************
* Clock
Current
: converts
current
system date to
clock units
* Clock
FromSysdate
: converts
a
system date to
movie clock
*****************************************************************************
*****************************************************************************
* Caution : a valid reference point is needed for this to operate.
* Caution : a valid reference point is needed for this to operate.
*****************************************************************************/
*****************************************************************************/
static
mtime_t
Clock
Current
(
input_clock_t
*
cl
)
static
mtime_t
Clock
FromSysdate
(
input_clock_t
*
cl
,
mtime_t
i_ck_system
)
{
{
assert
(
cl
->
b_has_reference
);
assert
(
cl
->
b_has_reference
);
return
(
mdate
()
-
cl
->
sysdate_ref
)
*
INPUT_RATE_DEFAULT
/
cl
->
i_rate
+
return
(
i_ck_system
-
cl
->
sysdate_ref
)
*
INPUT_RATE_DEFAULT
/
cl
->
i_rate
+
cl
->
cr_ref
;
cl
->
cr_ref
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -185,7 +185,7 @@ void input_ClockSetPCR( input_thread_t *p_input,
...
@@ -185,7 +185,7 @@ void input_ClockSetPCR( input_thread_t *p_input,
if
(
!
b_synchronize
&&
i_ck_system
-
cl
->
last_update
>
200000
)
if
(
!
b_synchronize
&&
i_ck_system
-
cl
->
last_update
>
200000
)
{
{
/* Smooth clock reference variations. */
/* Smooth clock reference variations. */
const
mtime_t
i_extrapoled_clock
=
Clock
Current
(
cl
);
const
mtime_t
i_extrapoled_clock
=
Clock
FromSysdate
(
cl
,
i_ck_system
);
/* Bresenham algorithm to smooth variations. */
/* Bresenham algorithm to smooth variations. */
const
mtime_t
i_tmp
=
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
+
const
mtime_t
i_tmp
=
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
+
(
i_extrapoled_clock
-
i_ck_stream
)
*
1
+
(
i_extrapoled_clock
-
i_ck_stream
)
*
1
+
...
...
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