the idea is to detect an IDR: SPS + PPS + frame which can be decoded. this block is not entered if we already split extradata. this means that extradata has to be cleared in case of decode fails. see work of @popcornmix:
https://github.com/popcornmix/xbmc/commit/cda4e3c2ccdcf8fbe8aba72c13b309c883995b0c