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
349970a6
Commit
349970a6
authored
Sep 10, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_framerate: calculate delta from scaled pts instead of unscaled
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
2b770345
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
vf_framerate.c
libavfilter/vf_framerate.c
+7
-12
No files found.
libavfilter/vf_framerate.c
View file @
349970a6
...
...
@@ -476,28 +476,23 @@ static void set_work_frame_pts(AVFilterContext *ctx)
average_srce_pts_delta
=
s
->
average_srce_pts_dest_delta
;
ff_dlog
(
ctx
,
"set_work_frame_pts() initial average srce pts:%"
PRId64
"
\n
"
,
average_srce_pts_delta
);
set_srce_frame_dest_pts
(
ctx
);
// calculate the PTS delta
if
((
pts
=
(
s
->
srce
[
s
->
next
]
->
pts
-
s
->
srce
[
s
->
crnt
]
->
pts
)))
{
if
((
pts
=
(
s
->
srce
_pts_dest
[
s
->
next
]
-
s
->
srce_pts_dest
[
s
->
crnt
]
)))
{
average_srce_pts_delta
=
average_srce_pts_delta
?
((
average_srce_pts_delta
+
pts
)
>>
1
)
:
pts
;
}
else
if
(
s
->
srce
[
s
->
prev
]
&&
(
pts
=
(
s
->
srce
[
s
->
crnt
]
->
pts
-
s
->
srce
[
s
->
prev
]
->
pts
)))
{
}
else
if
(
s
->
srce
[
s
->
prev
]
&&
(
pts
=
(
s
->
srce
_pts_dest
[
s
->
crnt
]
-
s
->
srce_pts_dest
[
s
->
prev
]
)))
{
average_srce_pts_delta
=
average_srce_pts_delta
?
((
average_srce_pts_delta
+
pts
)
>>
1
)
:
pts
;
}
s
->
average_srce_pts_dest_delta
=
av
_rescale_q
(
average_srce_pts_delta
,
s
->
srce_time_base
,
s
->
dest_time_base
)
;
s
->
average_srce_pts_dest_delta
=
av
erage_srce_pts_delta
;
ff_dlog
(
ctx
,
"set_work_frame_pts() average srce pts:%"
PRId64
"
\n
"
,
average_srce_pts_delta
);
ff_dlog
(
ctx
,
"set_work_frame_pts() average srce pts:%"
PRId64
" at dest time base:%u/%u
\n
"
,
s
->
average_srce_pts_dest_delta
,
s
->
dest_time_base
.
num
,
s
->
dest_time_base
.
den
);
set_srce_frame_dest_pts
(
ctx
);
if
(
ctx
->
inputs
[
0
]
&&
!
s
->
average_dest_pts_delta
)
{
int64_t
d
=
av_q2d
(
av_inv_q
(
av_mul_q
(
s
->
srce_time_base
,
s
->
dest_frame_rate
)));
if
(
d
==
0
)
{
// FIXME
av_log
(
ctx
,
AV_LOG_WARNING
,
"Buggy path reached, use settb filter before this filter!
\n
"
);
d
=
av_q2d
(
av_mul_q
(
ctx
->
inputs
[
0
]
->
time_base
,
s
->
dest_frame_rate
));
}
s
->
average_dest_pts_delta
=
av_rescale_q
(
d
,
s
->
srce_time_base
,
s
->
dest_time_base
);
ff_dlog
(
ctx
,
"set_frame_pts() average output pts from input timebase
\n
"
);
int64_t
d
=
av_q2d
(
av_inv_q
(
av_mul_q
(
s
->
dest_time_base
,
s
->
dest_frame_rate
)));
s
->
average_dest_pts_delta
=
d
;
ff_dlog
(
ctx
,
"set_work_frame_pts() average dest pts delta:%"
PRId64
"
\n
"
,
s
->
average_dest_pts_delta
);
}
...
...
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