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
30c3ea22
Commit
30c3ea22
authored
Sep 25, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed last_pts by using max value.
parent
2a41f846
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
src/input/clock.c
src/input/clock.c
+15
-7
No files found.
src/input/clock.c
View file @
30c3ea22
...
@@ -99,7 +99,8 @@ struct input_clock_t
...
@@ -99,7 +99,8 @@ struct input_clock_t
mtime_t
i_system
;
mtime_t
i_system
;
}
last
;
}
last
;
mtime_t
last_pts
;
/* Maixmal timestamp returned by input_clock_GetTS (in system unit) */
mtime_t
i_ts_max
;
/* Clock drift */
/* Clock drift */
mtime_t
i_delta_update
;
/* System time to wait for drift update */
mtime_t
i_delta_update
;
/* System time to wait for drift update */
...
@@ -164,7 +165,8 @@ input_clock_t *input_clock_New( bool b_master, int i_cr_average, int i_rate )
...
@@ -164,7 +165,8 @@ input_clock_t *input_clock_New( bool b_master, int i_cr_average, int i_rate )
cl
->
last
.
i_clock
=
0
;
cl
->
last
.
i_clock
=
0
;
cl
->
last
.
i_system
=
0
;
cl
->
last
.
i_system
=
0
;
cl
->
last_pts
=
0
;
cl
->
i_ts_max
=
0
;
cl
->
i_delta
=
0
;
cl
->
i_delta
=
0
;
cl
->
i_delta_residue
=
0
;
cl
->
i_delta_residue
=
0
;
...
@@ -214,7 +216,7 @@ void input_clock_SetPCR( input_clock_t *cl,
...
@@ -214,7 +216,7 @@ void input_clock_SetPCR( input_clock_t *cl,
* warning from the stream control facilities (dd-edited
* warning from the stream control facilities (dd-edited
* stream ?). */
* stream ?). */
msg_Warn
(
p_log
,
"clock gap, unexpected stream discontinuity"
);
msg_Warn
(
p_log
,
"clock gap, unexpected stream discontinuity"
);
cl
->
last_pts
=
0
;
cl
->
i_ts_max
=
0
;
/* */
/* */
msg_Warn
(
p_log
,
"feeding synchro with a new reference point trying to recover from clock gap"
);
msg_Warn
(
p_log
,
"feeding synchro with a new reference point trying to recover from clock gap"
);
...
@@ -227,7 +229,7 @@ void input_clock_SetPCR( input_clock_t *cl,
...
@@ -227,7 +229,7 @@ void input_clock_SetPCR( input_clock_t *cl,
/* Feed synchro with a new reference point. */
/* Feed synchro with a new reference point. */
ClockSetReference
(
cl
,
i_ck_stream
,
ClockSetReference
(
cl
,
i_ck_stream
,
__MAX
(
cl
->
last_pts
+
CR_MEAN_PTS_GAP
,
i_ck_system
)
);
__MAX
(
cl
->
i_ts_max
+
CR_MEAN_PTS_GAP
,
i_ck_system
)
);
}
}
cl
->
last
.
i_clock
=
i_ck_stream
;
cl
->
last
.
i_clock
=
i_ck_stream
;
...
@@ -255,7 +257,7 @@ void input_clock_SetPCR( input_clock_t *cl,
...
@@ -255,7 +257,7 @@ void input_clock_SetPCR( input_clock_t *cl,
void
input_clock_ResetPCR
(
input_clock_t
*
cl
)
void
input_clock_ResetPCR
(
input_clock_t
*
cl
)
{
{
cl
->
b_has_reference
=
false
;
cl
->
b_has_reference
=
false
;
cl
->
last_pts
=
0
;
cl
->
i_ts_max
=
0
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -264,11 +266,17 @@ void input_clock_ResetPCR( input_clock_t *cl )
...
@@ -264,11 +266,17 @@ void input_clock_ResetPCR( input_clock_t *cl )
mtime_t
input_clock_GetTS
(
input_clock_t
*
cl
,
mtime_t
input_clock_GetTS
(
input_clock_t
*
cl
,
mtime_t
i_pts_delay
,
mtime_t
i_ts
)
mtime_t
i_pts_delay
,
mtime_t
i_ts
)
{
{
mtime_t
i_converted_ts
;
if
(
!
cl
->
b_has_reference
)
if
(
!
cl
->
b_has_reference
)
return
0
;
return
0
;
cl
->
last_pts
=
ClockStreamToSystem
(
cl
,
i_ts
+
cl
->
i_delta
);
/* */
return
cl
->
last_pts
+
i_pts_delay
;
i_converted_ts
=
ClockStreamToSystem
(
cl
,
i_ts
+
cl
->
i_delta
);
if
(
i_converted_ts
>
cl
->
i_ts_max
)
cl
->
i_ts_max
=
i_converted_ts
;
return
i_converted_ts
+
i_pts_delay
;
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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