Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
538d2492
Commit
538d2492
authored
Nov 09, 2005
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clock: Fixed rounding error in clock smoothing algorithm.
Also removed a long unused member from the clock struct.
parent
01c9ca88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
src/input/clock.c
src/input/clock.c
+11
-4
src/input/input_internal.h
src/input/input_internal.h
+1
-2
No files found.
src/input/clock.c
View file @
538d2492
...
...
@@ -136,7 +136,7 @@ void input_ClockInit( input_clock_t *cl, vlc_bool_t b_master, int i_cr_average )
cl
->
cr_ref
=
0
;
cl
->
sysdate_ref
=
0
;
cl
->
delta_cr
=
0
;
cl
->
c_average_count
=
0
;
cl
->
i_delta_cr_residue
=
0
;
cl
->
i_cr_average
=
i_cr_average
;
...
...
@@ -265,7 +265,7 @@ void input_ClockSetPCR( input_thread_t *p_input,
{
cl
->
last_cr
=
0
;
cl
->
delta_cr
=
0
;
cl
->
c_average_count
=
0
;
cl
->
i_delta_cr_residue
=
0
;
}
}
else
...
...
@@ -312,11 +312,18 @@ void input_ClockSetPCR( input_thread_t *p_input,
{
/* Smooth clock reference variations. */
mtime_t
i_extrapoled_clock
=
ClockCurrent
(
p_input
,
cl
);
mtime_t
delta_cr
;
/* Bresenham algorithm to smooth variations. */
cl
->
delta_cr
=
(
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
+
(
i_extrapoled_clock
-
i_clock
)
)
delta_cr
=
(
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
+
(
i_extrapoled_clock
-
i_clock
)
+
cl
->
i_delta_cr_residue
)
/
cl
->
i_cr_average
;
cl
->
i_delta_cr_residue
=
(
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
+
(
i_extrapoled_clock
-
i_clock
)
+
cl
->
i_delta_cr_residue
)
%
cl
->
i_cr_average
;
cl
->
delta_cr
=
delta_cr
;
}
}
}
...
...
src/input/input_internal.h
View file @
538d2492
...
...
@@ -136,14 +136,13 @@ typedef struct
mtime_t
last_cr
;
/* reference to detect unexpected stream
* discontinuities */
mtime_t
last_pts
;
count_t
c_average_count
;
/* counter used to compute dynamic average values */
int
i_synchro_state
;
vlc_bool_t
b_master
;
/* Config */
int
i_cr_average
;
int
i_delta_cr_residue
;
}
input_clock_t
;
void
input_ClockInit
(
input_clock_t
*
,
vlc_bool_t
b_master
,
int
i_cr_average
);
...
...
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