fix compilation without HAVE_AVCODEC_DECODE_AUDIO4
fix compilation in mingw
Implement JSON parsing