summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xine-utils/cpu_accel.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index 03e047aa0..3f3cd7b9c 100644
--- a/src/xine-utils/cpu_accel.c
+++ b/src/xine-utils/cpu_accel.c
@@ -156,21 +156,26 @@ uint32_t xine_mm_accel (void)
{
#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
static uint32_t accel;
+ static int initialized;
- accel = arch_accel ();
+ if (!initialized) {
+ accel = arch_accel ();
#ifdef ARCH_X86
- /* test OS support for SSE */
- if( accel & MM_ACCEL_X86_SSE ) {
- if (setjmp(sigill_return)) {
- accel &= ~(MM_ACCEL_X86_SSE|MM_ACCEL_X86_SSE2);
- } else {
- signal (SIGILL, sigill_handler);
- __asm __volatile ("xorps %xmm0, %xmm0");
- signal (SIGILL, SIG_DFL);
+ /* test OS support for SSE */
+ if( accel & MM_ACCEL_X86_SSE ) {
+ if (setjmp(sigill_return)) {
+ accel &= ~(MM_ACCEL_X86_SSE|MM_ACCEL_X86_SSE2);
+ } else {
+ signal (SIGILL, sigill_handler);
+ __asm __volatile ("xorps %xmm0, %xmm0");
+ signal (SIGILL, SIG_DFL);
+ }
}
- }
#endif /* ARCH_X86 */
+
+ initialized++;
+ }
return accel;