Support building with new libavcodec versions.

CODEC_ID_* has been replaced with AV_CODEC_ID_* upstream.

Sorry for the yesterday's screwup, now tested to build with Libav 0.8 and Libav 10 alpha 2.