--- xvid.c 2005/11/22 10:44:09 1.65.2.1 +++ xvid.c 2006/02/25 04:41:12 1.68 @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid.c,v 1.65.2.1 2005/11/22 10:44:09 suxen_drol Exp $ + * $Id: xvid.c,v 1.68 2006/02/25 04:41:12 suxen_drol Exp $ * ****************************************************************************/ @@ -636,7 +636,7 @@ * features there really are. */ if (cpu_flags & XVID_CPU_ASM) { /* SIMD state flusher */ - emms = emms_3dn; + emms = emms_mmx; /* DCT operators */ fdct = fdct_skal_x86_64; @@ -712,13 +712,21 @@ return XVID_ERR_VERSION; info->actual_version = XVID_VERSION; - info->build = "xvid-1.1.0"; + info->build = "xvid-1.2.0-dev"; info->cpu_flags = detect_cpu_flags(); + info->num_threads = 0; -#if defined(_SMP) && defined(WIN32) - info->num_threads = pthread_num_processors_np();; -#else - info->num_threads = 0; +#if defined(WIN32) + { + DWORD dwProcessAffinityMask, dwSystemAffinityMask; + if (GetProcessAffinityMask(GetCurrentProcess(), &dwProcessAffinityMask, &dwSystemAffinityMask)) { + int i; + for(i=0; i<32; i++) { + if ((dwProcessAffinityMask & (1<num_threads++; + } + } + } #endif return 0;