Add missing headers.
AVCodecID instead of CodecID if ffmpeg >= 2.0.
Replace deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE.