I am using libavcodec to decode a H264 stream. As the stream is received from network, sometimes NALs can be missing, resulting in artifacts in the frame. The frame is afterwards rendered with DirectShow.
When there is an error during decoding, it is signaled by libavcodec log callback. The problem is - some artifacts will persist though multiple frames and libavcodec won't signal artifacts for the frames following the broken one.
I would like to render only frames below certain artifacts level, while avoiding to show frame that are too "broken". Can an artifact level of a decoded picture be figured out through a libavcodec API, or I need to detect those artifacts by myself (in such case, are there any best practices?)?