They cause crashes in avresample.
SSE* optimizations are still enabled, so the performance hit should be pretty minimal.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5409
b64f7644-9d1e-0410-96f1-
a4d463321fa5
void hb_avcodec_init()
{
- av_lockmgr_register( ff_lockmgr_cb );
+ av_lockmgr_register(ff_lockmgr_cb);
av_register_all();
+#ifdef _WIN64
+ // avresample's assembly optimizations can cause crashes under Win x86_64
+ // (see http://bugzilla.libav.org/show_bug.cgi?id=496)
+ // disable AVX and FMA4 as a workaround
+ hb_deep_log(2, "hb_avcodec_init: Windows x86_64, disabling AVX and FMA4");
+ int cpu_flags = av_get_cpu_flags() & ~AV_CPU_FLAG_AVX & ~AV_CPU_FLAG_FMA4;
+ av_set_cpu_flags_mask(cpu_flags);
+#endif
}
int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec,