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
05d69922
Commit
05d69922
authored
Feb 06, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libx264: split extradata writing out of encode_nals().
This is done in preparation for the following patch.
parent
52f82a11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
libx264.c
libavcodec/libx264.c
+14
-12
No files found.
libavcodec/libx264.c
View file @
05d69922
...
...
@@ -99,13 +99,6 @@ static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size,
}
for
(
i
=
0
;
i
<
nnal
;
i
++
){
/* Don't put the SEI in extradata. */
if
(
skip_sei
&&
nals
[
i
].
i_type
==
NAL_SEI
)
{
x4
->
sei_size
=
nals
[
i
].
i_payload
;
x4
->
sei
=
av_malloc
(
x4
->
sei_size
);
memcpy
(
x4
->
sei
,
nals
[
i
].
p_payload
,
nals
[
i
].
i_payload
);
continue
;
}
memcpy
(
p
,
nals
[
i
].
p_payload
,
nals
[
i
].
i_payload
);
p
+=
nals
[
i
].
i_payload
;
}
...
...
@@ -403,16 +396,25 @@ static av_cold int X264_init(AVCodecContext *avctx)
if
(
avctx
->
flags
&
CODEC_FLAG_GLOBAL_HEADER
)
{
x264_nal_t
*
nal
;
uint8_t
*
p
;
int
nnal
,
s
,
i
;
s
=
x264_encoder_headers
(
x4
->
enc
,
&
nal
,
&
nnal
);
avctx
->
extradata
=
p
=
av_malloc
(
s
);
for
(
i
=
0
;
i
<
nnal
;
i
++
)
if
(
nal
[
i
].
i_type
==
NAL_SEI
)
for
(
i
=
0
;
i
<
nnal
;
i
++
)
{
/* Don't put the SEI in extradata. */
if
(
nal
[
i
].
i_type
==
NAL_SEI
)
{
av_log
(
avctx
,
AV_LOG_INFO
,
"%s
\n
"
,
nal
[
i
].
p_payload
+
25
);
avctx
->
extradata
=
av_malloc
(
s
);
avctx
->
extradata_size
=
encode_nals
(
avctx
,
avctx
->
extradata
,
s
,
nal
,
nnal
,
1
);
x4
->
sei_size
=
nal
[
i
].
i_payload
;
x4
->
sei
=
av_malloc
(
x4
->
sei_size
);
memcpy
(
x4
->
sei
,
nal
[
i
].
p_payload
,
nal
[
i
].
i_payload
);
continue
;
}
memcpy
(
p
,
nal
[
i
].
p_payload
,
nal
[
i
].
i_payload
);
p
+=
nal
[
i
].
i_payload
;
}
avctx
->
extradata_size
=
p
-
avctx
->
extradata
;
}
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