supporting both ffmpeg 1.x and libav, fix #159