| 618 | } |
| 619 | |
| 620 | void hb_common_global_init(int disable_hardware) |
| 621 | { |
| 622 | static int common_init_done = 0; |
| 623 | if (common_init_done) |
| 624 | return; |
| 625 | |
| 626 | if (!disable_hardware) |
| 627 | { |
| 628 | hb_common_global_hw_init(); |
| 629 | } |
| 630 | |
| 631 | int i, j; |
| 632 | |
| 633 | // video framerates |
| 634 | for (i = 0; i < hb_video_rates_count; i++) |
| 635 | { |
| 636 | if (hb_video_rates[i].enabled) |
| 637 | { |
| 638 | if (hb_video_rates_first_item == NULL) |
| 639 | { |
| 640 | hb_video_rates_first_item = &hb_video_rates[i].item; |
| 641 | } |
| 642 | else |
| 643 | { |
| 644 | ((hb_rate_internal_t*)hb_video_rates_last_item)->next = |
| 645 | &hb_video_rates[i].item; |
| 646 | } |
| 647 | hb_video_rates_last_item = &hb_video_rates[i].item; |
| 648 | } |
| 649 | } |
| 650 | // fallbacks are static for now (no setup required) |
| 651 | |
| 652 | // audio samplerates |
| 653 | for (i = 0; i < hb_audio_rates_count; i++) |
| 654 | { |
| 655 | if (hb_audio_rates[i].enabled) |
| 656 | { |
| 657 | if (hb_audio_rates_first_item == NULL) |
| 658 | { |
| 659 | hb_audio_rates_first_item = &hb_audio_rates[i].item; |
| 660 | } |
| 661 | else |
| 662 | { |
| 663 | ((hb_rate_internal_t*)hb_audio_rates_last_item)->next = |
| 664 | &hb_audio_rates[i].item; |
| 665 | } |
| 666 | hb_audio_rates_last_item = &hb_audio_rates[i].item; |
| 667 | } |
| 668 | } |
| 669 | // fallbacks are static for now (no setup required) |
| 670 | |
| 671 | // audio bitrates |
| 672 | for (i = 0; i < hb_audio_bitrates_count; i++) |
| 673 | { |
| 674 | if (hb_audio_bitrates[i].enabled) |
| 675 | { |
| 676 | if (hb_audio_bitrates_first_item == NULL) |
| 677 | { |
no test coverage detected