Fix compilation on Debian 8 with libavcodec

Fixing https://code.google.com/p/dolphin-emu/issues/detail?id=7408
A new version of libavcodec was the problem.

I am a C and C++ beginner, so I might have introduced problems, so my code should be reviewed.
Thanks.