Fix compiling with latest ffmpeg master
Propperly lock ffmpeg
Merge pull request #1 from BtbN/ffmpeg-2.1

Ffmpeg 2.1