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
34a8de86
Commit
34a8de86
authored
Feb 23, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/snowenc: Allocate and reference coded_frame correctly
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
96e7c9cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
snowenc.c
libavcodec/snowenc.c
+5
-2
No files found.
libavcodec/snowenc.c
View file @
34a8de86
...
...
@@ -124,7 +124,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
ff_set_cmp
(
&
s
->
mecc
,
s
->
mecc
.
me_sub_cmp
,
s
->
avctx
->
me_sub_cmp
);
s
->
input_picture
=
av_frame_alloc
();
if
(
!
s
->
input_picture
)
avctx
->
coded_frame
=
av_frame_alloc
();
if
(
!
s
->
input_picture
||
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
if
((
ret
=
ff_snow_get_buffer
(
s
,
s
->
input_picture
))
<
0
)
...
...
@@ -1620,7 +1621,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
ff_snow_frame_start
(
s
);
avctx
->
coded_frame
=
s
->
current_picture
;
av_frame_unref
(
avctx
->
coded_frame
);
av_frame_ref
(
avctx
->
coded_frame
,
s
->
current_picture
);
s
->
m
.
current_picture_ptr
=
&
s
->
m
.
current_picture
;
s
->
m
.
current_picture
.
f
=
s
->
current_picture
;
...
...
@@ -1862,6 +1864,7 @@ static av_cold int encode_end(AVCodecContext *avctx)
ff_snow_common_end
(
s
);
ff_rate_control_uninit
(
&
s
->
m
);
av_frame_free
(
&
s
->
input_picture
);
av_frame_free
(
&
avctx
->
coded_frame
);
av_freep
(
&
avctx
->
stats_out
);
return
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