avcodec: set avpkt->size to 0 if encode2() did not output a packet