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
c214cd18
Commit
c214cd18
authored
Dec 11, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/select: in select_frame(), rename picref -> ref
The variable is now used also for audio frames.
parent
e7a0b2e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
f_select.c
libavfilter/f_select.c
+14
-14
No files found.
libavfilter/f_select.c
View file @
c214cd18
...
...
@@ -237,38 +237,38 @@ static double get_scene_score(AVFilterContext *ctx, AVFilterBufferRef *picref)
#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
static
int
select_frame
(
AVFilterContext
*
ctx
,
AVFilterBufferRef
*
pic
ref
)
static
int
select_frame
(
AVFilterContext
*
ctx
,
AVFilterBufferRef
*
ref
)
{
SelectContext
*
select
=
ctx
->
priv
;
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
double
res
;
if
(
isnan
(
select
->
var_values
[
VAR_START_PTS
]))
select
->
var_values
[
VAR_START_PTS
]
=
TS2D
(
pic
ref
->
pts
);
select
->
var_values
[
VAR_START_PTS
]
=
TS2D
(
ref
->
pts
);
if
(
isnan
(
select
->
var_values
[
VAR_START_T
]))
select
->
var_values
[
VAR_START_T
]
=
TS2D
(
pic
ref
->
pts
)
*
av_q2d
(
inlink
->
time_base
);
select
->
var_values
[
VAR_START_T
]
=
TS2D
(
ref
->
pts
)
*
av_q2d
(
inlink
->
time_base
);
select
->
var_values
[
VAR_PTS
]
=
TS2D
(
pic
ref
->
pts
);
select
->
var_values
[
VAR_T
]
=
TS2D
(
pic
ref
->
pts
)
*
av_q2d
(
inlink
->
time_base
);
select
->
var_values
[
VAR_POS
]
=
picref
->
pos
==
-
1
?
NAN
:
pic
ref
->
pos
;
select
->
var_values
[
VAR_PREV_PTS
]
=
TS2D
(
pic
ref
->
pts
);
select
->
var_values
[
VAR_PTS
]
=
TS2D
(
ref
->
pts
);
select
->
var_values
[
VAR_T
]
=
TS2D
(
ref
->
pts
)
*
av_q2d
(
inlink
->
time_base
);
select
->
var_values
[
VAR_POS
]
=
ref
->
pos
==
-
1
?
NAN
:
ref
->
pos
;
select
->
var_values
[
VAR_PREV_PTS
]
=
TS2D
(
ref
->
pts
);
switch
(
inlink
->
type
)
{
case
AVMEDIA_TYPE_AUDIO
:
select
->
var_values
[
VAR_SAMPLES_N
]
=
pic
ref
->
audio
->
nb_samples
;
select
->
var_values
[
VAR_SAMPLES_N
]
=
ref
->
audio
->
nb_samples
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
select
->
var_values
[
VAR_INTERLACE_TYPE
]
=
!
picref
->
video
->
interlaced
?
INTERLACE_TYPE_P
:
pic
ref
->
video
->
top_field_first
?
INTERLACE_TYPE_T
:
INTERLACE_TYPE_B
;
select
->
var_values
[
VAR_PICT_TYPE
]
=
pic
ref
->
video
->
pict_type
;
!
ref
->
video
->
interlaced
?
INTERLACE_TYPE_P
:
ref
->
video
->
top_field_first
?
INTERLACE_TYPE_T
:
INTERLACE_TYPE_B
;
select
->
var_values
[
VAR_PICT_TYPE
]
=
ref
->
video
->
pict_type
;
if
(
CONFIG_AVCODEC
&&
select
->
do_scene_detect
)
{
char
buf
[
32
];
select
->
var_values
[
VAR_SCENE
]
=
get_scene_score
(
ctx
,
pic
ref
);
select
->
var_values
[
VAR_SCENE
]
=
get_scene_score
(
ctx
,
ref
);
// TODO: document metadata
snprintf
(
buf
,
sizeof
(
buf
),
"%f"
,
select
->
var_values
[
VAR_SCENE
]);
av_dict_set
(
&
pic
ref
->
metadata
,
"lavfi.scene_score"
,
buf
,
0
);
av_dict_set
(
&
ref
->
metadata
,
"lavfi.scene_score"
,
buf
,
0
);
}
break
;
}
...
...
@@ -305,7 +305,7 @@ static int select_frame(AVFilterContext *ctx, AVFilterBufferRef *picref)
select
->
var_values
[
VAR_PREV_SELECTED_T
]
=
select
->
var_values
[
VAR_T
];
select
->
var_values
[
VAR_SELECTED_N
]
+=
1
.
0
;
if
(
inlink
->
type
==
AVMEDIA_TYPE_AUDIO
)
select
->
var_values
[
VAR_CONSUMED_SAMPLES_N
]
+=
pic
ref
->
audio
->
nb_samples
;
select
->
var_values
[
VAR_CONSUMED_SAMPLES_N
]
+=
ref
->
audio
->
nb_samples
;
}
select
->
var_values
[
VAR_N
]
+=
1
.
0
;
...
...
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