diff options
author | Martin Matuska <mm@FreeBSD.org> | 2010-07-24 15:30:17 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2010-07-24 15:30:17 +0000 |
commit | 165386783ba6531e28f1bca60cd816a88a4f565f (patch) | |
tree | 595ff5d059002dcd6d13a16697308567acd720e4 /multimedia/x264/files/patch-common_cpu.c | |
parent | - Update to 1.3.5 (diff) |
- Update x264 to 20100624 (build 98)
Notes
Notes:
svn path=/head/; revision=258146
Diffstat (limited to 'multimedia/x264/files/patch-common_cpu.c')
-rw-r--r-- | multimedia/x264/files/patch-common_cpu.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/multimedia/x264/files/patch-common_cpu.c b/multimedia/x264/files/patch-common_cpu.c index 3dee424cc366..b1c529d67055 100644 --- a/multimedia/x264/files/patch-common_cpu.c +++ b/multimedia/x264/files/patch-common_cpu.c @@ -1,30 +1,29 @@ ---- common/cpu.c.orig 2010-02-28 10:49:54.000000000 -0800 -+++ common/cpu.c 2010-02-28 10:56:06.000000000 -0800 -@@ -211,6 +211,27 @@ - return cpu; - } +--- common/cpu.c.orig 2010-06-24 22:45:07.000000000 +0200 ++++ common/cpu.c 2010-07-18 22:55:49.324572565 +0200 +@@ -234,7 +234,7 @@ -+#elif defined(SYS_FREEBSD) -+#include <sys/sysctl.h> -+uint32_t x264_cpu_detect( void ) -+{ -+ uint32_t cpu; -+ int has_altivec, error; -+ size_t length; -+ -+ cpu = 0; -+ has_altivec = 0; -+ length = sizeof( has_altivec ); -+ error = sysctlbyname("hw.altivec", &has_altivec, &length, NULL, 0 ); -+ -+ if( error == 0 && has_altivec != 0 ) -+ { -+ cpu |= X264_CPU_ALTIVEC; -+ } -+ -+ return cpu; -+} -+ - #elif defined( SYS_LINUX ) - #include <signal.h> - #include <setjmp.h> + #elif ARCH_PPC + +-#if SYS_MACOSX || SYS_OPENBSD ++#if SYS_MACOSX || SYS_OPENBSD || SYS_FREEBSD + #include <sys/sysctl.h> + uint32_t x264_cpu_detect( void ) + { +@@ -242,12 +242,16 @@ + uint32_t cpu = 0; + #if SYS_OPENBSD + int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC }; +-#else ++#elif SYS_MACOSX + int selectors[2] = { CTL_HW, HW_VECTORUNIT }; + #endif + int has_altivec = 0; + size_t length = sizeof( has_altivec ); ++#if SYS_MACOSX || SYS_OPENBSD + int error = sysctl( selectors, 2, &has_altivec, &length, NULL, 0 ); ++#else ++ int error = sysctlbyname("hw.altivec", &has_altivec, &length, NULL, 0 ); ++#endif + + if( error == 0 && has_altivec != 0 ) + cpu |= X264_CPU_ALTIVEC; |