Skip to content
Snippets Groups Projects
Commit 0cf1f70d authored by Stan Seibert's avatar Stan Seibert
Browse files

Default driver is now identified when ao_default_driver_id() is called

rather than ao_initialize().  This has the benefit of avoiding autodetection
unless is it necessary.


git-svn-id: http://svn.xiph.org/trunk/ao@1854 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 7396b8be
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
typedef struct ao_config { typedef struct ao_config {
char *default_driver; char *default_driver;
int default_driver_id;
} ao_config; } ao_config;
/* --- Functions --- */ /* --- Functions --- */
......
...@@ -71,7 +71,6 @@ ao_functions *static_drivers[] = { ...@@ -71,7 +71,6 @@ ao_functions *static_drivers[] = {
driver_list *driver_head = NULL; driver_list *driver_head = NULL;
ao_config config = { ao_config config = {
NULL, /* default_driver */ NULL, /* default_driver */
-1, /* default_driver_id */
}; };
ao_info **info_table = NULL; ao_info **info_table = NULL;
...@@ -85,7 +84,6 @@ void _clear_config() ...@@ -85,7 +84,6 @@ void _clear_config()
{ {
free(config.default_driver); free(config.default_driver);
config.default_driver = NULL; config.default_driver = NULL;
config.default_driver_id = -1;
} }
...@@ -506,10 +504,6 @@ void ao_initialize(void) ...@@ -506,10 +504,6 @@ void ao_initialize(void)
_append_dynamic_drivers(end); _append_dynamic_drivers(end);
} }
/* Find the default driver in the list of loaded drivers */
config.default_driver_id =
_find_default_driver_id(config.default_driver);
/* Create the table of driver info structs */ /* Create the table of driver info structs */
info_table = _make_info_table(driver_head, &driver_count); info_table = _make_info_table(driver_head, &driver_count);
} }
...@@ -680,7 +674,9 @@ int ao_driver_id(const char *short_name) ...@@ -680,7 +674,9 @@ int ao_driver_id(const char *short_name)
int ao_default_driver_id () int ao_default_driver_id ()
{ {
return config.default_driver_id; /* Find the default driver in the list of loaded drivers */
return _find_default_driver_id(config.default_driver);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment