Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
7a13592f
Commit
7a13592f
authored
Nov 10, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/input/clock.c, input_internal.h: backport of 13165.
parent
882a7a61
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 @
7a13592f
...
@@ -136,7 +136,7 @@ void input_ClockInit( input_clock_t *cl, vlc_bool_t b_master, int i_cr_average )
...
@@ -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
->
cr_ref
=
0
;
cl
->
sysdate_ref
=
0
;
cl
->
sysdate_ref
=
0
;
cl
->
delta_cr
=
0
;
cl
->
delta_cr
=
0
;
cl
->
c_average_count
=
0
;
cl
->
i_delta_cr_residue
=
0
;
cl
->
i_cr_average
=
i_cr_average
;
cl
->
i_cr_average
=
i_cr_average
;
...
@@ -265,7 +265,7 @@ void input_ClockSetPCR( input_thread_t *p_input,
...
@@ -265,7 +265,7 @@ void input_ClockSetPCR( input_thread_t *p_input,
{
{
cl
->
last_cr
=
0
;
cl
->
last_cr
=
0
;
cl
->
delta_cr
=
0
;
cl
->
delta_cr
=
0
;
cl
->
c_average_count
=
0
;
cl
->
i_delta_cr_residue
=
0
;
}
}
}
}
else
else
...
@@ -312,11 +312,18 @@ void input_ClockSetPCR( input_thread_t *p_input,
...
@@ -312,11 +312,18 @@ void input_ClockSetPCR( input_thread_t *p_input,
{
{
/* Smooth clock reference variations. */
/* Smooth clock reference variations. */
mtime_t
i_extrapoled_clock
=
ClockCurrent
(
p_input
,
cl
);
mtime_t
i_extrapoled_clock
=
ClockCurrent
(
p_input
,
cl
);
mtime_t
delta_cr
;
/* Bresenham algorithm to smooth variations. */
/* Bresenham algorithm to smooth variations. */
cl
->
delta_cr
=
(
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
delta_cr
=
(
cl
->
delta_cr
*
(
cl
->
i_cr_average
-
1
)
+
(
i_extrapoled_clock
-
i_clock
)
)
+
(
i_extrapoled_clock
-
i_clock
)
+
cl
->
i_delta_cr_residue
)
/
cl
->
i_cr_average
;
/
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 @
7a13592f
...
@@ -136,14 +136,13 @@ typedef struct
...
@@ -136,14 +136,13 @@ typedef struct
mtime_t
last_cr
;
/* reference to detect unexpected stream
mtime_t
last_cr
;
/* reference to detect unexpected stream
* discontinuities */
* discontinuities */
mtime_t
last_pts
;
mtime_t
last_pts
;
count_t
c_average_count
;
/* counter used to compute dynamic average values */
int
i_synchro_state
;
int
i_synchro_state
;
vlc_bool_t
b_master
;
vlc_bool_t
b_master
;
/* Config */
/* Config */
int
i_cr_average
;
int
i_cr_average
;
int
i_delta_cr_residue
;
}
input_clock_t
;
}
input_clock_t
;
void
input_ClockInit
(
input_clock_t
*
,
vlc_bool_t
b_master
,
int
i_cr_average
);
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