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
21 21
22int av_get_cpu_flags(void)22int av_get_cpu_flags(void)
23{23{
24 if (ARCH_ARM) return ff_get_cpu_flags_arm();24 static int flags, checked;
25 if (ARCH_PPC) return ff_get_cpu_flags_ppc();25
26 if (ARCH_X86) return ff_get_cpu_flags_x86();26 if (checked)
27 return 0;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;
28}35}
29 36
30#ifdef TEST37#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