diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 17:41:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 17:59:27 +0200 |
commit | c9c7a776db3615b627dde75b9b9e3e786da43827 (patch) | |
tree | 3e658a318bf4416370ccc4b6507d4c74c072d72d /libavcodec/h264.c | |
parent | fe70c1f45f108c73ebb9c23009e271a96336796f (diff) | |
download | ffmpeg-c9c7a776db3615b627dde75b9b9e3e786da43827.tar.gz |
h264: try reading SPS with wrong escaping, it sometimes works better
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 2ea141e0df..792775494a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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)) |