Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
f09ae730
Commit
f09ae730
authored
Dec 02, 2019
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/buffersrc: push frame directly.
This allows to remove the queued frame entirely.
parent
02daafb4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
buffersrc.c
libavfilter/buffersrc.c
+4
-12
No files found.
libavfilter/buffersrc.c
View file @
f09ae730
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
typedef
struct
BufferSourceContext
{
typedef
struct
BufferSourceContext
{
const
AVClass
*
class
;
const
AVClass
*
class
;
AVFrame
*
queued_frame
;
AVRational
time_base
;
///< time_base to set in the output link
AVRational
time_base
;
///< time_base to set in the output link
AVRational
frame_rate
;
///< frame_rate to set in the output link
AVRational
frame_rate
;
///< frame_rate to set in the output link
unsigned
nb_failed_requests
;
unsigned
nb_failed_requests
;
...
@@ -241,11 +240,11 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
...
@@ -241,11 +240,11 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
}
}
}
}
av_assert0
(
s
->
queued_frame
==
NULL
);
ret
=
ff_filter_frame
(
ctx
->
outputs
[
0
],
copy
);
s
->
queued_frame
=
copy
;
if
(
ret
<
0
)
{
if
((
ret
=
ctx
->
output_pads
[
0
].
request_frame
(
ctx
->
outputs
[
0
]))
<
0
)
av_frame_free
(
&
copy
);
return
ret
;
return
ret
;
av_assert0
(
s
->
queued_frame
==
NULL
);
}
if
((
flags
&
AV_BUFFERSRC_FLAG_PUSH
))
{
if
((
flags
&
AV_BUFFERSRC_FLAG_PUSH
))
{
ret
=
push_frame
(
ctx
->
graph
);
ret
=
push_frame
(
ctx
->
graph
);
...
@@ -369,7 +368,6 @@ static av_cold int init_audio(AVFilterContext *ctx)
...
@@ -369,7 +368,6 @@ static av_cold int init_audio(AVFilterContext *ctx)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
{
BufferSourceContext
*
s
=
ctx
->
priv
;
BufferSourceContext
*
s
=
ctx
->
priv
;
av_assert0
(
s
->
queued_frame
==
NULL
);
av_buffer_unref
(
&
s
->
hw_frames_ctx
);
av_buffer_unref
(
&
s
->
hw_frames_ctx
);
}
}
...
@@ -443,16 +441,10 @@ static int request_frame(AVFilterLink *link)
...
@@ -443,16 +441,10 @@ static int request_frame(AVFilterLink *link)
AVFrame
*
frame
;
AVFrame
*
frame
;
int
ret
;
int
ret
;
if
(
!
c
->
queued_frame
)
{
if
(
c
->
eof
)
if
(
c
->
eof
)
return
AVERROR_EOF
;
return
AVERROR_EOF
;
c
->
nb_failed_requests
++
;
c
->
nb_failed_requests
++
;
return
AVERROR
(
EAGAIN
);
return
AVERROR
(
EAGAIN
);
}
frame
=
c
->
queued_frame
;
c
->
queued_frame
=
NULL
;
ret
=
ff_filter_frame
(
link
,
frame
);
return
ret
;
}
}
static
const
AVFilterPad
avfilter_vsrc_buffer_outputs
[]
=
{
static
const
AVFilterPad
avfilter_vsrc_buffer_outputs
[]
=
{
...
...
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