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
002b0499
Commit
002b0499
authored
Oct 18, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_ladspa: check functions return value in query_formats
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
62144b22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
+37
-13
af_ladspa.c
libavfilter/af_ladspa.c
+37
-13
No files found.
libavfilter/af_ladspa.c
View file @
002b0499
...
@@ -597,22 +597,29 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -597,22 +597,29 @@ static int query_formats(AVFilterContext *ctx)
AVFilterChannelLayouts
*
layouts
;
AVFilterChannelLayouts
*
layouts
;
static
const
enum
AVSampleFormat
sample_fmts
[]
=
{
static
const
enum
AVSampleFormat
sample_fmts
[]
=
{
AV_SAMPLE_FMT_FLTP
,
AV_SAMPLE_FMT_NONE
};
AV_SAMPLE_FMT_FLTP
,
AV_SAMPLE_FMT_NONE
};
int
ret
;
formats
=
ff_make_format_list
(
sample_fmts
);
formats
=
ff_make_format_list
(
sample_fmts
);
if
(
!
formats
)
if
(
!
formats
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
ff_set_common_formats
(
ctx
,
formats
);
ret
=
ff_set_common_formats
(
ctx
,
formats
);
if
(
ret
<
0
)
return
ret
;
if
(
s
->
nb_inputs
)
{
if
(
s
->
nb_inputs
)
{
formats
=
ff_all_samplerates
();
formats
=
ff_all_samplerates
();
if
(
!
formats
)
if
(
!
formats
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
ff_set_common_samplerates
(
ctx
,
formats
);
ret
=
ff_set_common_samplerates
(
ctx
,
formats
);
if
(
ret
<
0
)
return
ret
;
}
else
{
}
else
{
int
sample_rates
[]
=
{
s
->
sample_rate
,
-
1
};
int
sample_rates
[]
=
{
s
->
sample_rate
,
-
1
};
ff_set_common_samplerates
(
ctx
,
ff_make_format_list
(
sample_rates
));
ret
=
ff_set_common_samplerates
(
ctx
,
ff_make_format_list
(
sample_rates
));
if
(
ret
<
0
)
return
ret
;
}
}
if
(
s
->
nb_inputs
==
1
&&
s
->
nb_outputs
==
1
)
{
if
(
s
->
nb_inputs
==
1
&&
s
->
nb_outputs
==
1
)
{
...
@@ -621,11 +628,17 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -621,11 +628,17 @@ static int query_formats(AVFilterContext *ctx)
if
(
!
layouts
)
if
(
!
layouts
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
ff_set_common_channel_layouts
(
ctx
,
layouts
);
ret
=
ff_set_common_channel_layouts
(
ctx
,
layouts
);
if
(
ret
<
0
)
return
ret
;
}
else
if
(
s
->
nb_inputs
==
2
&&
s
->
nb_outputs
==
2
)
{
}
else
if
(
s
->
nb_inputs
==
2
&&
s
->
nb_outputs
==
2
)
{
layouts
=
NULL
;
layouts
=
NULL
;
ff_add_channel_layout
(
&
layouts
,
AV_CH_LAYOUT_STEREO
);
ret
=
ff_add_channel_layout
(
&
layouts
,
AV_CH_LAYOUT_STEREO
);
ff_set_common_channel_layouts
(
ctx
,
layouts
);
if
(
ret
<
0
)
return
ret
;
ret
=
ff_set_common_channel_layouts
(
ctx
,
layouts
);
if
(
ret
<
0
)
return
ret
;
}
else
{
}
else
{
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
...
@@ -634,19 +647,30 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -634,19 +647,30 @@ static int query_formats(AVFilterContext *ctx)
int64_t
inlayout
=
FF_COUNT2LAYOUT
(
s
->
nb_inputs
);
int64_t
inlayout
=
FF_COUNT2LAYOUT
(
s
->
nb_inputs
);
layouts
=
NULL
;
layouts
=
NULL
;
ff_add_channel_layout
(
&
layouts
,
inlayout
);
ret
=
ff_add_channel_layout
(
&
layouts
,
inlayout
);
ff_channel_layouts_ref
(
layouts
,
&
inlink
->
out_channel_layouts
);
if
(
ret
<
0
)
return
ret
;
if
(
!
s
->
nb_outputs
)
ret
=
ff_channel_layouts_ref
(
layouts
,
&
inlink
->
out_channel_layouts
);
ff_channel_layouts_ref
(
layouts
,
&
outlink
->
in_channel_layouts
);
if
(
ret
<
0
)
return
ret
;
if
(
!
s
->
nb_outputs
)
{
ret
=
ff_channel_layouts_ref
(
layouts
,
&
outlink
->
in_channel_layouts
);
if
(
ret
<
0
)
return
ret
;
}
}
}
if
(
s
->
nb_outputs
>=
1
)
{
if
(
s
->
nb_outputs
>=
1
)
{
int64_t
outlayout
=
FF_COUNT2LAYOUT
(
s
->
nb_outputs
);
int64_t
outlayout
=
FF_COUNT2LAYOUT
(
s
->
nb_outputs
);
layouts
=
NULL
;
layouts
=
NULL
;
ff_add_channel_layout
(
&
layouts
,
outlayout
);
ret
=
ff_add_channel_layout
(
&
layouts
,
outlayout
);
ff_channel_layouts_ref
(
layouts
,
&
outlink
->
in_channel_layouts
);
if
(
ret
<
0
)
return
ret
;
ret
=
ff_channel_layouts_ref
(
layouts
,
&
outlink
->
in_channel_layouts
);
if
(
ret
<
0
)
return
ret
;
}
}
}
}
...
...
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