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
3fd79833
Commit
3fd79833
authored
Oct 13, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: add ff_alloc_extradata() helper
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
fe448cd2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
internal.h
libavformat/internal.h
+9
-0
utils.c
libavformat/utils.c
+20
-0
No files found.
libavformat/internal.h
View file @
3fd79833
...
@@ -361,4 +361,13 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precissi
...
@@ -361,4 +361,13 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precissi
*/
*/
void
ff_generate_avci_extradata
(
AVStream
*
st
);
void
ff_generate_avci_extradata
(
AVStream
*
st
);
/**
* Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0.
*
* @param size size of extradata
* @return 0 if OK, AVERROR_xxx on error
*/
int
ff_alloc_extradata
(
AVCodecContext
*
avctx
,
int
size
);
#endif
/* AVFORMAT_INTERNAL_H */
#endif
/* AVFORMAT_INTERNAL_H */
libavformat/utils.c
View file @
3fd79833
...
@@ -2678,6 +2678,26 @@ int av_find_stream_info(AVFormatContext *ic)
...
@@ -2678,6 +2678,26 @@ int av_find_stream_info(AVFormatContext *ic)
}
}
#endif
#endif
int
ff_alloc_extradata
(
AVCodecContext
*
avctx
,
int
size
)
{
int
ret
;
if
(
size
<
0
||
size
>=
INT32_MAX
-
FF_INPUT_BUFFER_PADDING_SIZE
)
{
avctx
->
extradata_size
=
0
;
return
AVERROR
(
EINVAL
);
}
avctx
->
extradata
=
av_malloc
(
size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
avctx
->
extradata
)
{
memset
(
avctx
->
extradata
+
size
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
avctx
->
extradata_size
=
size
;
ret
=
0
;
}
else
{
avctx
->
extradata_size
=
0
;
ret
=
AVERROR
(
ENOMEM
);
}
return
ret
;
}
int
avformat_find_stream_info
(
AVFormatContext
*
ic
,
AVDictionary
**
options
)
int
avformat_find_stream_info
(
AVFormatContext
*
ic
,
AVDictionary
**
options
)
{
{
int
i
,
count
,
ret
=
0
,
j
;
int
i
,
count
,
ret
=
0
,
j
;
...
...
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