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
d1b28411
Commit
d1b28411
authored
Nov 20, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_afir: add missing error check
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
200f4979
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
af_afir.c
libavfilter/af_afir.c
+18
-11
No files found.
libavfilter/af_afir.c
View file @
d1b28411
...
...
@@ -267,11 +267,13 @@ static int read_ir(AVFilterLink *link, AVFrame *frame)
{
AVFilterContext
*
ctx
=
link
->
dst
;
AudioFIRContext
*
s
=
ctx
->
priv
;
int
nb_taps
,
max_nb_taps
;
int
nb_taps
,
max_nb_taps
,
ret
;
av_audio_fifo_write
(
s
->
fifo
[
1
],
(
void
**
)
frame
->
extended_data
,
frame
->
nb_samples
);
ret
=
av_audio_fifo_write
(
s
->
fifo
[
1
],
(
void
**
)
frame
->
extended_data
,
frame
->
nb_samples
);
av_frame_free
(
&
frame
);
if
(
ret
<
0
)
return
ret
;
nb_taps
=
av_audio_fifo_size
(
s
->
fifo
[
1
]);
max_nb_taps
=
MAX_IR_DURATION
*
ctx
->
outputs
[
0
]
->
sample_rate
;
...
...
@@ -288,15 +290,18 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
AVFilterContext
*
ctx
=
link
->
dst
;
AudioFIRContext
*
s
=
ctx
->
priv
;
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
int
ret
=
0
;
int
ret
;
av_audio_fifo_write
(
s
->
fifo
[
0
],
(
void
**
)
frame
->
extended_data
,
frame
->
nb_samples
);
if
(
s
->
pts
==
AV_NOPTS_VALUE
)
ret
=
av_audio_fifo_write
(
s
->
fifo
[
0
],
(
void
**
)
frame
->
extended_data
,
frame
->
nb_samples
);
if
(
ret
>
0
&&
s
->
pts
==
AV_NOPTS_VALUE
)
s
->
pts
=
frame
->
pts
;
av_frame_free
(
&
frame
);
if
(
ret
<
0
)
return
ret
;
if
(
!
s
->
have_coeffs
&&
s
->
eof_coeffs
)
{
ret
=
convert_coeffs
(
ctx
);
if
(
ret
<
0
)
...
...
@@ -307,10 +312,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
while
(
av_audio_fifo_size
(
s
->
fifo
[
0
])
>=
s
->
part_size
)
{
ret
=
fir_frame
(
s
,
outlink
);
if
(
ret
<
0
)
break
;
return
ret
;
}
}
return
ret
;
return
0
;
}
static
int
request_frame
(
AVFilterLink
*
outlink
)
...
...
@@ -334,9 +339,11 @@ static int request_frame(AVFilterLink *outlink)
if
(
!
silence
)
return
AVERROR
(
ENOMEM
);
av_audio_fifo_write
(
s
->
fifo
[
0
],
(
void
**
)
silence
->
extended_data
,
silence
->
nb_samples
);
ret
=
av_audio_fifo_write
(
s
->
fifo
[
0
],
(
void
**
)
silence
->
extended_data
,
silence
->
nb_samples
);
av_frame_free
(
&
silence
);
if
(
ret
<
0
)
return
ret
;
s
->
need_padding
=
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