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
4ba39683
Commit
4ba39683
authored
Sep 23, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: pass buffer & size to ff_h264_decode_extradata()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
57d5d5f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
h264.c
libavcodec/h264.c
+7
-7
h264.h
libavcodec/h264.h
+1
-1
h264_parser.c
libavcodec/h264_parser.c
+1
-1
No files found.
libavcodec/h264.c
View file @
4ba39683
...
...
@@ -991,17 +991,17 @@ static av_cold void common_init(H264Context *h){
memset
(
h
->
pps
.
scaling_matrix8
,
16
,
2
*
64
*
sizeof
(
uint8_t
));
}
int
ff_h264_decode_extradata
(
H264Context
*
h
)
int
ff_h264_decode_extradata
(
H264Context
*
h
,
const
uint8_t
*
buf
,
int
size
)
{
AVCodecContext
*
avctx
=
h
->
s
.
avctx
;
if
(
avctx
->
extradata
[
0
]
==
1
){
if
(
buf
[
0
]
==
1
){
int
i
,
cnt
,
nalsize
;
unsigned
char
*
p
=
avctx
->
extradata
;
const
unsigned
char
*
p
=
buf
;
h
->
is_avc
=
1
;
if
(
avctx
->
extradata_
size
<
7
)
{
if
(
size
<
7
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"avcC too short
\n
"
);
return
-
1
;
}
...
...
@@ -1030,10 +1030,10 @@ int ff_h264_decode_extradata(H264Context *h)
p
+=
nalsize
;
}
// Now store right nal length size, that will be use to parse all other nals
h
->
nal_length_size
=
(
avctx
->
extradata
[
4
]
&
0x03
)
+
1
;
h
->
nal_length_size
=
(
buf
[
4
]
&
0x03
)
+
1
;
}
else
{
h
->
is_avc
=
0
;
if
(
decode_nal_units
(
h
,
avctx
->
extradata
,
avctx
->
extradata_
size
)
<
0
)
if
(
decode_nal_units
(
h
,
buf
,
size
)
<
0
)
return
-
1
;
}
return
0
;
...
...
@@ -1077,7 +1077,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){
}
if
(
avctx
->
extradata_size
>
0
&&
avctx
->
extradata
&&
ff_h264_decode_extradata
(
h
))
ff_h264_decode_extradata
(
h
,
avctx
->
extradata
,
avctx
->
extradata_size
))
return
-
1
;
if
(
h
->
sps
.
bitstream_restriction_flag
&&
s
->
avctx
->
has_b_frames
<
h
->
sps
.
num_reorder_frames
){
...
...
libavcodec/h264.h
View file @
4ba39683
...
...
@@ -672,7 +672,7 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode);
void
ff_h264_hl_decode_mb
(
H264Context
*
h
);
int
ff_h264_frame_start
(
H264Context
*
h
);
int
ff_h264_decode_extradata
(
H264Context
*
h
);
int
ff_h264_decode_extradata
(
H264Context
*
h
,
const
uint8_t
*
buf
,
int
size
);
av_cold
int
ff_h264_decode_init
(
AVCodecContext
*
avctx
);
av_cold
int
ff_h264_decode_end
(
AVCodecContext
*
avctx
);
av_cold
void
ff_h264_decode_init_vlc
(
void
);
...
...
libavcodec/h264_parser.c
View file @
4ba39683
...
...
@@ -257,7 +257,7 @@ static int h264_parse(AVCodecParserContext *s,
// Note that estimate_timings_from_pts does exactly this.
if
(
!
avctx
->
has_b_frames
)
h
->
s
.
low_delay
=
1
;
ff_h264_decode_extradata
(
h
);
ff_h264_decode_extradata
(
h
,
avctx
->
extradata
,
avctx
->
extradata_size
);
}
}
...
...
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