void va_gl_library_constructor(void) { handle_initialize_storage(); // Initialize global data initialize_quirks(); // initialize tracer traceSetTarget(stdout); traceSetHook(trc_hk, NULL); traceInfo("Software VDPAU backend library initialized\n"); #ifdef NDEBUG traceEnableTracing(0); #else traceEnableTracing(1); #endif const char *value = getenv("VDPAU_LOG"); if (value) { // enable tracing when variable present traceEnableTracing(1); char *value_lc = strdup(value); // convert to lowercase for (int k = 0; value_lc[k] != 0; k ++) value_lc[k] = tolower(value_lc[k]); // and disable tracing when variable value equals one of the following values if (!strcmp(value_lc, "0") || !strcmp(value_lc, "false") || !strcmp(value_lc, "off") || !strcmp(value_lc, "disable") || !strcmp(value_lc, "disabled")) { traceEnableTracing(0); } free(value_lc); } }
void fpp_config_initialize(void) { if (initialized) return; config_t cfg; char *local_config = get_local_config_path(config_file_name); char *global_config = get_global_config_path(config_file_name); config = default_config; config_init(&cfg); if (!config_read_file(&cfg, local_config)) { if (!config_read_file(&cfg, global_config)) { goto quit; } } long long intval; const char *stringval; if (config_lookup_int64(&cfg, "audio_buffer_min_ms", &intval)) { config.audio_buffer_min_ms = intval; } if (config_lookup_int64(&cfg, "audio_buffer_max_ms", &intval)) { config.audio_buffer_max_ms = intval; } if (config_lookup_int64(&cfg, "xinerama_screen", &intval)) { config.xinerama_screen = intval; } if (config_lookup_string(&cfg, "pepperflash_path", &stringval)) { config.pepperflash_path = strdup(stringval); } if (config_lookup_string(&cfg, "flash_command_line", &stringval)) { config.flash_command_line = strdup(stringval); } if (config_lookup_int64(&cfg, "enable_3d", &intval)) { config.enable_3d = intval; } config_destroy(&cfg); quit: g_free(local_config); g_free(global_config); initialize_quirks(); // calculate plugin data directory local_config = get_local_config_path(config_dir_name); pepper_data_dir = g_strdup_printf("%s/%s", local_config, fpp_config_get_plugin_name()); pepper_salt_file_name = g_strdup_printf("%s/%s", local_config, salt_file_name); g_free(local_config); initialized = 1; }