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
104a97be
Commit
104a97be
authored
Jan 16, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffersrc: handle non-refcounted frames in av_buffersrc_add_frame() correctly
parent
5ef11b8d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
buffersrc.c
libavfilter/buffersrc.c
+15
-3
No files found.
libavfilter/buffersrc.c
View file @
104a97be
...
@@ -94,7 +94,7 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
...
@@ -94,7 +94,7 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
{
{
BufferSourceContext
*
s
=
ctx
->
priv
;
BufferSourceContext
*
s
=
ctx
->
priv
;
AVFrame
*
copy
;
AVFrame
*
copy
;
int
ret
;
int
re
fcounted
,
re
t
;
if
(
!
frame
)
{
if
(
!
frame
)
{
s
->
eof
=
1
;
s
->
eof
=
1
;
...
@@ -102,6 +102,8 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
...
@@ -102,6 +102,8 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
}
else
if
(
s
->
eof
)
}
else
if
(
s
->
eof
)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
refcounted
=
!!
frame
->
buf
[
0
];
switch
(
ctx
->
outputs
[
0
]
->
type
)
{
switch
(
ctx
->
outputs
[
0
]
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
case
AVMEDIA_TYPE_VIDEO
:
CHECK_VIDEO_PARAM_CHANGE
(
ctx
,
s
,
frame
->
width
,
frame
->
height
,
CHECK_VIDEO_PARAM_CHANGE
(
ctx
,
s
,
frame
->
width
,
frame
->
height
,
...
@@ -122,9 +124,19 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
...
@@ -122,9 +124,19 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
if
(
!
(
copy
=
av_frame_alloc
()))
if
(
!
(
copy
=
av_frame_alloc
()))
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
if
(
refcounted
)
{
av_frame_move_ref
(
copy
,
frame
);
av_frame_move_ref
(
copy
,
frame
);
}
else
{
ret
=
av_frame_ref
(
copy
,
frame
);
if
(
ret
<
0
)
{
av_frame_free
(
&
copy
);
return
ret
;
}
}
if
((
ret
=
av_fifo_generic_write
(
s
->
fifo
,
&
copy
,
sizeof
(
copy
),
NULL
))
<
0
)
{
if
((
ret
=
av_fifo_generic_write
(
s
->
fifo
,
&
copy
,
sizeof
(
copy
),
NULL
))
<
0
)
{
if
(
refcounted
)
av_frame_move_ref
(
frame
,
copy
);
av_frame_move_ref
(
frame
,
copy
);
av_frame_free
(
&
copy
);
av_frame_free
(
&
copy
);
return
ret
;
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