Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e341cb11
Commit
e341cb11
authored
Feb 17, 2013
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: fix compute_target_delay to better handle frames with long durations
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
5b492720
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
ffplay.c
ffplay.c
+11
-5
No files found.
ffplay.c
View file @
e341cb11
...
...
@@ -69,8 +69,12 @@ const int program_birth_year = 2003;
A/V sync as SDL does not have hardware buffer fullness info. */
#define SDL_AUDIO_BUFFER_SIZE 1024
/* no AV sync correction is done if below the AV sync threshold */
#define AV_SYNC_THRESHOLD 0.01
/* no AV sync correction is done if below the minimum AV sync threshold */
#define AV_SYNC_THRESHOLD_MIN 0.01
/* AV sync correction is done if above the maximum AV sync threshold */
#define AV_SYNC_THRESHOLD_MAX 0.1
/* If a frame duration is longer than this, it will not be duplicated to compensate AV sync */
#define AV_SYNC_FRAMEDUP_THRESHOLD 0.1
/* no AV correction is done if too big error */
#define AV_NOSYNC_THRESHOLD 10.0
...
...
@@ -1257,10 +1261,12 @@ static double compute_target_delay(double delay, VideoState *is)
/* skip or repeat frame. We take into account the
delay to compute the threshold. I still don't know
if it is the best guess */
sync_threshold
=
FFMAX
(
AV_SYNC_THRESHOLD
,
delay
);
if
(
!
isnan
(
diff
)
&&
fabs
(
diff
)
<
AV_NOSYNC_THRESHOLD
)
{
sync_threshold
=
FFMAX
(
AV_SYNC_THRESHOLD
_MIN
,
FFMIN
(
AV_SYNC_THRESHOLD_MAX
,
delay
)
);
if
(
!
isnan
(
diff
)
&&
fabs
(
diff
)
<
is
->
max_frame_duration
)
{
if
(
diff
<=
-
sync_threshold
)
delay
=
0
;
delay
=
FFMAX
(
0
,
delay
+
diff
);
else
if
(
diff
>=
sync_threshold
&&
delay
>
AV_SYNC_FRAMEDUP_THRESHOLD
)
delay
=
delay
+
diff
;
else
if
(
diff
>=
sync_threshold
)
delay
=
2
*
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