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
553c5e9f
Commit
553c5e9f
authored
Sep 16, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add and use an inlink variable in avfilter_config_links()
Simplify expressions, improve readability.
parent
71c644ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
avfilter.c
libavfilter/avfilter.c
+11
-10
No files found.
libavfilter/avfilter.c
View file @
553c5e9f
...
...
@@ -246,6 +246,8 @@ int avfilter_config_links(AVFilterContext *filter)
for
(
i
=
0
;
i
<
filter
->
input_count
;
i
++
)
{
AVFilterLink
*
link
=
filter
->
inputs
[
i
];
AVFilterLink
*
inlink
=
link
->
src
->
input_count
?
link
->
src
->
inputs
[
0
]
:
NULL
;
if
(
!
link
)
continue
;
...
...
@@ -275,18 +277,17 @@ int avfilter_config_links(AVFilterContext *filter)
switch
(
link
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
if
(
!
link
->
time_base
.
num
&&
!
link
->
time_base
.
den
)
link
->
time_base
=
link
->
src
->
input_count
?
link
->
src
->
inputs
[
0
]
->
time_base
:
AV_TIME_BASE_Q
;
link
->
time_base
=
inlink
?
inlink
->
time_base
:
AV_TIME_BASE_Q
;
if
(
!
link
->
sample_aspect_ratio
.
num
&&
!
link
->
sample_aspect_ratio
.
den
)
link
->
sample_aspect_ratio
=
link
->
src
->
input_count
?
link
->
src
->
inputs
[
0
]
->
sample_aspect_ratio
:
(
AVRational
){
1
,
1
};
link
->
sample_aspect_ratio
=
inlink
?
inlink
->
sample_aspect_ratio
:
(
AVRational
){
1
,
1
};
if
(
link
->
src
->
input_count
)
{
if
(
inlink
)
{
if
(
!
link
->
w
)
link
->
w
=
link
->
src
->
inputs
[
0
]
->
w
;
link
->
w
=
inlink
->
w
;
if
(
!
link
->
h
)
link
->
h
=
link
->
src
->
inputs
[
0
]
->
h
;
link
->
h
=
inlink
->
h
;
}
else
if
(
!
link
->
w
||
!
link
->
h
)
{
av_log
(
link
->
src
,
AV_LOG_ERROR
,
"Video source filters must set their output link's "
...
...
@@ -296,11 +297,11 @@ int avfilter_config_links(AVFilterContext *filter)
break
;
case
AVMEDIA_TYPE_AUDIO
:
if
(
link
->
src
->
input_count
)
{
if
(
inlink
)
{
if
(
!
link
->
sample_rate
)
link
->
sample_rate
=
link
->
src
->
inputs
[
0
]
->
sample_rate
;
link
->
sample_rate
=
inlink
->
sample_rate
;
if
(
!
link
->
time_base
.
num
&&
!
link
->
time_base
.
den
)
link
->
time_base
=
link
->
src
->
inputs
[
0
]
->
time_base
;
link
->
time_base
=
inlink
->
time_base
;
}
else
if
(
!
link
->
sample_rate
)
{
av_log
(
link
->
src
,
AV_LOG_ERROR
,
"Audio source filters must set their output link's "
...
...
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