h264: avoid unnecessary calls to get_format