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
c9c7a776
Commit
c9c7a776
authored
Oct 01, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: try reading SPS with wrong escaping, it sometimes works better
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
fe70c1f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
h264.c
libavcodec/h264.c
+5
-1
h264_ps.c
libavcodec/h264_ps.c
+4
-1
No files found.
libavcodec/h264.c
View file @
c9c7a776
...
...
@@ -3801,7 +3801,11 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
break
;
case
NAL_SPS
:
init_get_bits
(
&
s
->
gb
,
ptr
,
bit_length
);
ff_h264_decode_seq_parameter_set
(
h
);
if
(
ff_h264_decode_seq_parameter_set
(
h
)
<
0
&&
h
->
is_avc
&&
(
nalsize
!=
consumed
)
&&
nalsize
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_DEBUG
,
"SPS decoding failure, trying alternative mode
\n
"
);
init_get_bits
(
&
s
->
gb
,
&
buf
[
buf_index
+
1
-
consumed
],
8
*
nalsize
);
ff_h264_decode_seq_parameter_set
(
h
);
}
if
(
s
->
flags
&
CODEC_FLAG_LOW_DELAY
||
(
h
->
sps
.
bitstream_restriction_flag
&&
!
h
->
sps
.
num_reorder_frames
))
...
...
libavcodec/h264_ps.c
View file @
c9c7a776
...
...
@@ -228,7 +228,6 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
get_ue_golomb
(
&
s
->
gb
);
/*max_dec_frame_buffering*/
if
(
s
->
gb
.
size_in_bits
<
get_bits_count
(
&
s
->
gb
)){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"Overread VUI by %d bits
\n
"
,
get_bits_count
(
&
s
->
gb
)
-
s
->
gb
.
size_in_bits
);
sps
->
num_reorder_frames
=
0
;
sps
->
bitstream_restriction_flag
=
0
;
}
...
...
@@ -238,6 +237,10 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
return
-
1
;
}
}
if
(
s
->
gb
.
size_in_bits
<
get_bits_count
(
&
s
->
gb
)){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"Overread VUI by %d bits
\n
"
,
get_bits_count
(
&
s
->
gb
)
-
s
->
gb
.
size_in_bits
);
return
-
1
;
}
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