githubのコードからのfolk
Revision | f7a7eaca69b887a91039717492387862ccc22265 (tree) |
---|---|
Time | 2011-02-27 02:22:36 |
Author | sr55 <sr55@b64f...> |
Commiter | sr55 |
Remove depreciated cpu count from the api
git-svn-id: svn://localhost/HandBrake/trunk@3813 b64f7644-9d1e-0410-96f1-a4d463321fa5
@@ -40,8 +40,6 @@ struct hb_handle_s | ||
40 | 40 | int work_error; |
41 | 41 | hb_thread_t * work_thread; |
42 | 42 | |
43 | - int cpu_count; | |
44 | - | |
45 | 43 | hb_lock_t * state_lock; |
46 | 44 | hb_state_t state; |
47 | 45 |
@@ -331,10 +329,6 @@ hb_handle_t * hb_init( int verbose, int update_check ) | ||
331 | 329 | */ |
332 | 330 | hb_buffer_pool_init(); |
333 | 331 | |
334 | - /* CPU count detection */ | |
335 | - hb_log( "hb_init: checking cpu count" ); | |
336 | - h->cpu_count = hb_get_cpu_count(); | |
337 | - | |
338 | 332 | h->list_title = hb_list_init(); |
339 | 333 | h->jobs = hb_list_init(); |
340 | 334 |
@@ -435,10 +429,6 @@ hb_handle_t * hb_init_dl( int verbose, int update_check ) | ||
435 | 429 | } |
436 | 430 | } |
437 | 431 | |
438 | - /* CPU count detection */ | |
439 | - hb_log( "hb_init: checking cpu count" ); | |
440 | - h->cpu_count = hb_get_cpu_count(); | |
441 | - | |
442 | 432 | h->list_title = hb_list_init(); |
443 | 433 | h->jobs = hb_list_init(); |
444 | 434 | h->current_job = NULL; |
@@ -1496,8 +1486,7 @@ void hb_start( hb_handle_t * h ) | ||
1496 | 1486 | h->paused = 0; |
1497 | 1487 | |
1498 | 1488 | h->work_die = 0; |
1499 | - h->work_thread = hb_work_init( h->jobs, h->cpu_count, | |
1500 | - &h->work_die, &h->work_error, &h->current_job ); | |
1489 | + h->work_thread = hb_work_init( h->jobs, &h->work_die, &h->work_error, &h->current_job ); | |
1501 | 1490 | } |
1502 | 1491 | |
1503 | 1492 | /** |
@@ -170,7 +170,7 @@ hb_thread_t * hb_scan_init( hb_handle_t *, volatile int * die, | ||
170 | 170 | const char * path, int title_index, |
171 | 171 | hb_list_t * list_title, int preview_count, |
172 | 172 | int store_previews, uint64_t min_duration ); |
173 | -hb_thread_t * hb_work_init( hb_list_t * jobs, int cpu_count, | |
173 | +hb_thread_t * hb_work_init( hb_list_t * jobs, | |
174 | 174 | volatile int * die, int * error, hb_job_t ** job ); |
175 | 175 | hb_thread_t * hb_reader_init( hb_job_t * ); |
176 | 176 | hb_work_object_t * hb_muxer_init( hb_job_t * ); |
@@ -13,14 +13,13 @@ typedef struct | ||
13 | 13 | { |
14 | 14 | hb_list_t * jobs; |
15 | 15 | hb_job_t ** current_job; |
16 | - int cpu_count; | |
17 | 16 | int * error; |
18 | 17 | volatile int * die; |
19 | 18 | |
20 | 19 | } hb_work_t; |
21 | 20 | |
22 | 21 | static void work_func(); |
23 | -static void do_job( hb_job_t *, int cpu_count ); | |
22 | +static void do_job( hb_job_t *); | |
24 | 23 | static void work_loop( void * ); |
25 | 24 | |
26 | 25 | #define FIFO_UNBOUNDED 65536 |
@@ -33,18 +32,15 @@ static void work_loop( void * ); | ||
33 | 32 | /** |
34 | 33 | * Allocates work object and launches work thread with work_func. |
35 | 34 | * @param jobs Handle to hb_list_t. |
36 | - * @param cpu_count Humber of CPUs found in system. | |
37 | 35 | * @param die Handle to user inititated exit indicator. |
38 | 36 | * @param error Handle to error indicator. |
39 | 37 | */ |
40 | -hb_thread_t * hb_work_init( hb_list_t * jobs, int cpu_count, | |
41 | - volatile int * die, int * error, hb_job_t ** job ) | |
38 | +hb_thread_t * hb_work_init( hb_list_t * jobs, volatile int * die, int * error, hb_job_t ** job ) | |
42 | 39 | { |
43 | 40 | hb_work_t * work = calloc( sizeof( hb_work_t ), 1 ); |
44 | 41 | |
45 | 42 | work->jobs = jobs; |
46 | 43 | work->current_job = job; |
47 | - work->cpu_count = cpu_count; | |
48 | 44 | work->die = die; |
49 | 45 | work->error = error; |
50 | 46 |
@@ -86,7 +82,7 @@ static void work_func( void * _work ) | ||
86 | 82 | job->die = work->die; |
87 | 83 | *(work->current_job) = job; |
88 | 84 | InitWorkState( job->h ); |
89 | - do_job( job, work->cpu_count ); | |
85 | + do_job( job ); | |
90 | 86 | *(work->current_job) = NULL; |
91 | 87 | } |
92 | 88 |
@@ -423,9 +419,8 @@ static int check_ff_audio( hb_list_t *list_audio, hb_audio_t *ff_audio ) | ||
423 | 419 | * Exits loop when conversion is done and fifos are empty. |
424 | 420 | * Closes threads and frees fifos. |
425 | 421 | * @param job Handle work hb_job_t. |
426 | - * @param cpu_count number of CPUs found in system. | |
427 | 422 | */ |
428 | -static void do_job( hb_job_t * job, int cpu_count ) | |
423 | +static void do_job( hb_job_t * job ) | |
429 | 424 | { |
430 | 425 | hb_title_t * title; |
431 | 426 | int i, j; |