[cvs] / xvidcore / src / xvid.c Repository:
ViewVC logotype

Diff of /xvidcore/src/xvid.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.80, Mon Dec 1 15:06:48 2008 UTC revision 1.81, Tue Jun 2 13:06:49 2009 UTC
# Line 32  Line 32 
32  #include <unistd.h>  #include <unistd.h>
33  #endif  #endif
34    
35    #if defined(__APPLE__) && defined(__MACH__) && !defined(_SC_NPROCESSORS_CONF)
36    #include <sys/types.h>
37    #include <sys/sysctl.h>
38    #ifdef MAX
39    #undef MAX
40    #endif
41    #ifdef MIN
42    #undef MIN
43    #endif
44    #endif
45    
46  #include "xvid.h"  #include "xvid.h"
47  #include "decoder.h"  #include "decoder.h"
48  #include "encoder.h"  #include "encoder.h"
# Line 667  Line 678 
678          info->actual_version = XVID_VERSION;          info->actual_version = XVID_VERSION;
679          info->build = "xvid-1.3.0-dev";          info->build = "xvid-1.3.0-dev";
680          info->cpu_flags = detect_cpu_flags();          info->cpu_flags = detect_cpu_flags();
681          info->num_threads = 0;          info->num_threads = 0; /* single-thread */
682    
683  #if defined(_WIN32)  #if defined(_WIN32)
684    
# Line 677  Line 688 
688          info->num_threads = siSysInfo.dwNumberOfProcessors; /* number of _logical_ cores */          info->num_threads = siSysInfo.dwNumberOfProcessors; /* number of _logical_ cores */
689    }    }
690    
691  #else  #elif defined(_SC_NPROCESSORS_CONF) /* should be available on Apple too actually */
692    
693    info->num_threads = sysconf(_SC_NPROCESSORS_CONF);    info->num_threads = sysconf(_SC_NPROCESSORS_CONF);
694    
695    #elif defined(__APPLE__) && defined(__MACH__)
696    
697      {
698        size_t len;
699        int    mib[2], ncpu;
700    
701        mib[0] = CTL_HW;
702        mib[1] = HW_NCPU;
703        len    = sizeof(ncpu);
704        if (sysctl(mib, 2, &ncpu, &len, NULL, 0) == 0)
705          info -> num_threads = ncpu;
706        else
707          info -> num_threads = 1;
708      }
709    
710  #endif  #endif
711    
712          return 0;          return 0;

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4