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
f266486b
Commit
f266486b
authored
Dec 12, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asyncts: fix flushing of final samples at EOF
parent
be75fed9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
af_asyncts.c
libavfilter/af_asyncts.c
+7
-7
No files found.
libavfilter/af_asyncts.c
View file @
f266486b
...
...
@@ -116,6 +116,12 @@ static int config_props(AVFilterLink *link)
return
0
;
}
/* get amount of data currently buffered, in samples */
static
int64_t
get_delay
(
ASyncContext
*
s
)
{
return
avresample_available
(
s
->
avr
)
+
avresample_get_delay
(
s
->
avr
);
}
static
int
request_frame
(
AVFilterLink
*
link
)
{
AVFilterContext
*
ctx
=
link
->
src
;
...
...
@@ -128,7 +134,7 @@ static int request_frame(AVFilterLink *link)
ret
=
ff_request_frame
(
ctx
->
inputs
[
0
]);
/* flush the fifo */
if
(
ret
==
AVERROR_EOF
&&
(
nb_samples
=
avresample_get_delay
(
s
->
avr
)))
{
if
(
ret
==
AVERROR_EOF
&&
(
nb_samples
=
get_delay
(
s
)))
{
AVFilterBufferRef
*
buf
=
ff_get_audio_buffer
(
link
,
AV_PERM_WRITE
,
nb_samples
);
if
(
!
buf
)
...
...
@@ -155,12 +161,6 @@ static int write_to_fifo(ASyncContext *s, AVFilterBufferRef *buf)
return
ret
;
}
/* get amount of data currently buffered, in samples */
static
int64_t
get_delay
(
ASyncContext
*
s
)
{
return
avresample_available
(
s
->
avr
)
+
avresample_get_delay
(
s
->
avr
);
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
buf
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
...
...
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