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
66747a61
Commit
66747a61
authored
Aug 03, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/muxing: simplify alloc_picture()
Use avpicture_alloc() high level function.
parent
e776ee8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
muxing.c
doc/examples/muxing.c
+3
-15
No files found.
doc/examples/muxing.c
View file @
66747a61
...
...
@@ -245,21 +245,9 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
static
AVFrame
*
alloc_picture
(
enum
PixelFormat
pix_fmt
,
int
width
,
int
height
)
{
AVFrame
*
picture
;
uint8_t
*
picture_buf
;
int
size
;
picture
=
avcodec_alloc_frame
();
if
(
!
picture
)
return
NULL
;
size
=
avpicture_get_size
(
pix_fmt
,
width
,
height
);
picture_buf
=
av_malloc
(
size
);
if
(
!
picture_buf
)
{
av_free
(
picture
);
return
NULL
;
}
avpicture_fill
((
AVPicture
*
)
picture
,
picture_buf
,
pix_fmt
,
width
,
height
);
AVFrame
*
picture
=
avcodec_alloc_frame
();
if
(
!
picture
||
avpicture_alloc
((
AVPicture
*
)
picture
,
pix_fmt
,
width
,
height
)
<
0
)
av_freep
(
&
picture
);
return
picture
;
}
...
...
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