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
7826fbfe
Commit
7826fbfe
authored
Jun 06, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_showspectrum: properly handle EOF case
parent
1c32d7df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+10
-6
No files found.
libavfilter/avf_showspectrum.c
View file @
7826fbfe
...
...
@@ -1434,7 +1434,8 @@ static int activate(AVFilterContext *ctx)
}
}
if
(
s
->
outpicref
&&
av_audio_fifo_size
(
s
->
fifo
)
>=
s
->
win_size
)
{
if
(
s
->
outpicref
&&
(
av_audio_fifo_size
(
s
->
fifo
)
>=
s
->
win_size
||
ff_outlink_get_status
(
inlink
)))
{
AVFrame
*
fin
=
ff_get_audio_buffer
(
inlink
,
s
->
win_size
);
if
(
!
fin
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -1462,7 +1463,7 @@ static int activate(AVFilterContext *ctx)
av_frame_free
(
&
fin
);
av_audio_fifo_drain
(
s
->
fifo
,
s
->
hop_size
);
if
(
ret
<=
0
)
if
(
ret
<=
0
&&
!
ff_outlink_get_status
(
inlink
)
)
return
ret
;
}
...
...
@@ -1493,15 +1494,18 @@ static int activate(AVFilterContext *ctx)
}
FF_FILTER_FORWARD_STATUS
(
inlink
,
outlink
);
if
(
ff_outlink_frame_wanted
(
outlink
)
&&
av_audio_fifo_size
(
s
->
fifo
)
<
s
->
win_size
)
{
ff_inlink_request_frame
(
inlink
);
if
(
av_audio_fifo_size
(
s
->
fifo
)
>=
s
->
win_size
||
ff_outlink_get_status
(
inlink
)
==
AVERROR_EOF
)
{
ff_filter_set_ready
(
ctx
,
10
);
return
0
;
}
if
(
av_audio_fifo_size
(
s
->
fifo
)
>=
s
->
win_size
)
{
ff_filter_set_ready
(
ctx
,
10
);
if
(
ff_outlink_frame_wanted
(
outlink
)
&&
av_audio_fifo_size
(
s
->
fifo
)
<
s
->
win_size
&&
ff_outlink_get_status
(
inlink
)
!=
AVERROR_EOF
)
{
ff_inlink_request_frame
(
inlink
);
return
0
;
}
return
FFERROR_NOT_READY
;
}
...
...
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