History

Cache detected CPU flags

Originally committed as revision 25085 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård committed 16 years ago

Commit a3f0d2b1 parent 92754381 file · +11 −4Browse files

Unified · Split

libavutil/cpu.c+11−4
@@ -21,10 +21,17 @@ · 20 unmodified lines
2121
2222 int av_get_cpu_flags(void)
2323 {
24− if (ARCH_ARM) return ff_get_cpu_flags_arm();
25− if (ARCH_PPC) return ff_get_cpu_flags_ppc();
26− if (ARCH_X86) return ff_get_cpu_flags_x86();
27− return 0;
24+ static int flags, checked;
25+
26+ if (checked)
27+ return flags;
28+
29+ if (ARCH_ARM) flags = ff_get_cpu_flags_arm();
30+ if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
31+ if (ARCH_X86) flags = ff_get_cpu_flags_x86();
32+
33+ checked = 1;
34+ return flags;
2835 }
2936
3037 #ifdef TEST

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t