Add missing check on the existence of avcodec_opts[AVMEDIA_TYPE_X],