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
461e810c
Commit
461e810c
authored
Nov 10, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/fade: use inlink->frame_count.
parent
3e1097b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
vf_fade.c
libavfilter/vf_fade.c
+4
-7
No files found.
libavfilter/vf_fade.c
View file @
461e810c
...
...
@@ -54,7 +54,6 @@ typedef struct {
int
type
;
int
factor
,
fade_per_frame
;
int
start_frame
,
nb_frames
;
unsigned
int
frame_index
;
int
hsub
,
vsub
,
bpp
;
unsigned
int
black_level
,
black_level_scaled
;
uint8_t
is_packed_rgb
;
...
...
@@ -278,7 +277,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if
(
s
->
fade_state
==
VF_FADE_WAITING
)
{
s
->
factor
=
0
;
if
((
frame_timestamp
>=
(
s
->
start_time
/
(
double
)
AV_TIME_BASE
))
&&
(
s
->
frame_index
>=
s
->
start_frame
))
{
&&
(
inlink
->
frame_count
>=
s
->
start_frame
))
{
// Time to start fading
s
->
fade_state
=
VF_FADE_FADING
;
...
...
@@ -289,15 +288,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
// Save start frame in case we are starting based on time and fading based on frames
if
((
s
->
start_time
!=
0
)
&&
(
s
->
start_frame
==
0
))
{
s
->
start_frame
=
s
->
frame_index
;
s
->
start_frame
=
inlink
->
frame_count
;
}
}
}
if
(
s
->
fade_state
==
VF_FADE_FADING
)
{
if
(
s
->
duration
==
0
)
{
// Fading based on frame count
s
->
factor
=
(
s
->
frame_index
-
s
->
start_frame
)
*
s
->
fade_per_frame
;
if
(
s
->
frame_index
>
(
s
->
start_frame
+
s
->
nb_frames
))
{
s
->
factor
=
(
inlink
->
frame_count
-
s
->
start_frame
)
*
s
->
fade_per_frame
;
if
(
inlink
->
frame_count
>
(
s
->
start_frame
+
s
->
nb_frames
))
{
s
->
fade_state
=
VF_FADE_DONE
;
}
...
...
@@ -342,8 +341,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
}
s
->
frame_index
++
;
return
ff_filter_frame
(
inlink
->
dst
->
outputs
[
0
],
frame
);
}
...
...
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