Support for CAP_DELAY

This adds support for flushing audio and video decoders by passing null packet. It also handles correctly case when audio decoder does not return any samples (also caused by CAP_DELAY).