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
ee4e8050
Commit
ee4e8050
authored
Dec 25, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: add ff_get_extradata()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ac480cb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
internal.h
libavformat/internal.h
+9
-0
utils.c
libavformat/utils.c
+16
-0
No files found.
libavformat/internal.h
View file @
ee4e8050
...
...
@@ -371,6 +371,15 @@ int ff_generate_avci_extradata(AVStream *st);
*/
int
ff_alloc_extradata
(
AVCodecContext
*
avctx
,
int
size
);
/**
* Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0 and fill it from pb.
*
* @param size size of extradata
* @return >= 0 if OK, AVERROR_xxx on error
*/
int
ff_get_extradata
(
AVCodecContext
*
avctx
,
AVIOContext
*
pb
,
int
size
);
/**
* add frame for rfps calculation.
*
...
...
libavformat/utils.c
View file @
ee4e8050
...
...
@@ -2701,6 +2701,22 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
return
ret
;
}
int
ff_get_extradata
(
AVCodecContext
*
avctx
,
AVIOContext
*
pb
,
int
size
)
{
int
ret
=
ff_alloc_extradata
(
avctx
,
size
);
if
(
ret
<
0
)
return
ret
;
ret
=
avio_read
(
pb
,
avctx
->
extradata
,
size
);
if
(
ret
!=
size
)
{
av_freep
(
&
avctx
->
extradata
);
avctx
->
extradata_size
=
0
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to read extradata of size %d
\n
"
,
size
);
return
ret
<
0
?
ret
:
AVERROR_INVALIDDATA
;
}
return
ret
;
}
int
ff_rfps_add_frame
(
AVFormatContext
*
ic
,
AVStream
*
st
,
int64_t
ts
)
{
int
i
,
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