Fix parser not to clobber has_b_frames when extradata is set.
authorReinhard Tartler <siretart@tauware.de>
Sun, 26 Feb 2012 09:50:45 +0000 (10:50 +0100)
committerReinhard Tartler <siretart@tauware.de>
Sun, 26 Feb 2012 14:50:59 +0000 (15:50 +0100)
commit790a367d9ecd04360f78616765ee723f3fe65645
tree9e06efabd10de5b76a50e757c1dc0bafb4805d6b
parentd3783f47eeed364aae9c916d1d659bf5f31c5ea0
Fix parser not to clobber has_b_frames when extradata is set.

Because in contrast to the decoder, the parser does not setup low_delay.
The code in parse_nal_units would always end up setting has_b_frames
to "1", except when stream is explicitly marked as low delay.
Since the parser itself would create 'extradata', simply reopening
the parser would cause this.

This happens for instance in estimate_timings_from_pts(), which causes the
parser to be reopened on the same stream.

This fixes Libav #22 and FFmpeg (trac) #360

CC: libav-stable@libav.org
Based on a patch by Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(commit 31ac0ac29b6bba744493f7d1040757a3f51b9ad7)

Comments and description adapted by Reinhard Tartler.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
libavcodec/h264_parser.c