Commit a3f0d2b9 authored by Måns Rullgård's avatar Måns Rullgård
Browse files

Cache detected CPU flags

Originally committed as revision 25085 to svn://
parent 9275438a
...@@ -21,10 +21,17 @@ ...@@ -21,10 +21,17 @@
int av_get_cpu_flags(void) int av_get_cpu_flags(void)
{ {
if (ARCH_ARM) return ff_get_cpu_flags_arm(); static int flags, checked;
if (ARCH_PPC) return ff_get_cpu_flags_ppc();
if (ARCH_X86) return ff_get_cpu_flags_x86(); if (checked)
return 0; return flags;
if (ARCH_ARM) flags = ff_get_cpu_flags_arm();
if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
if (ARCH_X86) flags = ff_get_cpu_flags_x86();
checked = 1;
return flags;
} }
#ifdef TEST #ifdef TEST
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment