h26[45]parser: Fix emulation prevention byte detection
authorWangfei <fei.w.wang@intel.com>
Thu, 15 Aug 2019 02:58:01 +0000 (10:58 +0800)
committerJan Schmidt <thaytan@noraisin.net>
Mon, 19 Aug 2019 05:01:24 +0000 (05:01 +0000)
commit55db6413d7dbe18651ea78b4d30831e54a7b6abd
treec9b82ea20aba5fbefca20a84c45ef4f7e9486027
parentca6657367cab2aa5976aa6139a9bf9dc58fd73b4
h26[45]parser: Fix emulation prevention byte detection

Add a separate epb_cache variable to the codecparser NalReader to
detect Emulation Prevention Bytes separately from the main bit cache.

This fixes problems where the existing logic can mistakenly detect
multiple EPB with a sequence like: 0x00 0x00 0x03 0x00 0x03. In that
case, the 5th byte should not be regarded as an EPB.
gst-libs/gst/codecparsers/nalutils.c
gst-libs/gst/codecparsers/nalutils.h