Support building with new libavcodec versions.

CODEC_ID_* has been replaced with AV_CODEC_ID_* upstream.
Merge pull request #325 from elenril/master

Support building with new libavcodec versions.