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
db0af725
Commit
db0af725
authored
Jun 28, 2016
by
Matthieu Bouron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/mediacodecdec_h264: add missing NAL headers to SPS/PPS buffers
Fixes a regression introduced by
0cd5e281
.
parent
8a3221cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
mediacodecdec_h264.c
libavcodec/mediacodecdec_h264.c
+19
-2
No files found.
libavcodec/mediacodecdec_h264.c
View file @
db0af725
...
...
@@ -112,8 +112,25 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
}
if
(
pps
&&
sps
)
{
ff_AMediaFormat_setBuffer
(
format
,
"csd-0"
,
(
void
*
)
sps
->
data
,
sps
->
data_size
);
ff_AMediaFormat_setBuffer
(
format
,
"csd-1"
,
(
void
*
)
pps
->
data
,
pps
->
data_size
);
static
const
uint8_t
nal_headers
[]
=
{
0x00
,
0x00
,
0x00
,
0x01
};
uint8_t
*
data
=
NULL
;
size_t
data_size
=
sizeof
(
nal_headers
)
+
FFMAX
(
sps
->
data_size
,
pps
->
data_size
);
data
=
av_mallocz
(
data_size
);
if
(
!
data
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
done
;
}
memcpy
(
data
,
nal_headers
,
sizeof
(
nal_headers
));
memcpy
(
data
+
sizeof
(
nal_headers
),
sps
->
data
,
sps
->
data_size
);
ff_AMediaFormat_setBuffer
(
format
,
"csd-0"
,
(
void
*
)
data
,
sizeof
(
nal_headers
)
+
sps
->
data_size
);
memcpy
(
data
+
sizeof
(
nal_headers
),
pps
->
data
,
pps
->
data_size
);
ff_AMediaFormat_setBuffer
(
format
,
"csd-1"
,
(
void
*
)
data
,
sizeof
(
nal_headers
)
+
pps
->
data_size
);
av_freep
(
&
data
);
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not extract PPS/SPS from extradata"
);
ret
=
AVERROR_INVALIDDATA
;
...
...
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