From 9a1b7e9c865032c9d4bff03a88c81927be8f777e Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 14 Aug 2001 01:38:17 +0000 Subject: audio output plugin priority handling, based on patch provided by Philip Stadermann CVS patchset: 423 CVS date: 2001/08/14 01:38:17 --- src/audio_out/audio_alsa_out.c | 6 +++--- src/audio_out/audio_esd_out.c | 4 ++-- src/audio_out/audio_oss_out.c | 4 ++-- src/audio_out/audio_sun_out.c | 4 ++-- src/xine-engine/load_plugins.c | 27 ++++++++++++++++++++++----- 5 files changed, 31 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index e76a0f730..5962bbb8b 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -24,7 +24,7 @@ * (c) 2001 James Courtier-Dutton * * - * $Id: audio_alsa_out.c,v 1.13 2001/08/01 18:17:40 joachim_koenig Exp $ + * $Id: audio_alsa_out.c,v 1.14 2001/08/14 01:38:17 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -684,7 +684,7 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) { return &this->ao_functions; } -static ao_info_t ao_info_alsa = { +static ao_info_t ao_info_alsa9 = { AUDIO_OUT_IFACE_VERSION, "alsa09", "xine audio output plugin using alsa-compliant audio devices/drivers", @@ -692,5 +692,5 @@ static ao_info_t ao_info_alsa = { }; ao_info_t *get_audio_out_plugin_info() { - return &ao_info_alsa; + return &ao_info_alsa9; } diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c index fedad7a12..4669c5b32 100644 --- a/src/audio_out/audio_esd_out.c +++ b/src/audio_out/audio_esd_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_esd_out.c,v 1.5 2001/06/25 08:46:55 guenter Exp $ + * $Id: audio_esd_out.c,v 1.6 2001/08/14 01:38:17 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -364,7 +364,7 @@ static ao_info_t ao_info_esd = { AUDIO_OUT_IFACE_VERSION, "esd", "xine audio output plugin using esd", - 1 + 5 }; ao_info_t *get_audio_out_plugin_info() { diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 19fc431fd..d077af9eb 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_oss_out.c,v 1.27 2001/08/12 01:03:55 guenter Exp $ + * $Id: audio_oss_out.c,v 1.28 2001/08/14 01:38:17 guenter Exp $ */ /* required for swab() */ @@ -721,7 +721,7 @@ static ao_info_t ao_info_oss = { AUDIO_OUT_IFACE_VERSION, "oss", "xine audio output plugin using oss-compliant audio devices/drivers", - 5 + 10 }; ao_info_t *get_audio_out_plugin_info() { diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index 3a37356c8..23a50b6bc 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_sun_out.c,v 1.4 2001/06/26 18:47:13 jkeil Exp $ + * $Id: audio_sun_out.c,v 1.5 2001/08/14 01:38:17 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -497,7 +497,7 @@ static ao_info_t ao_info_sun = { AUDIO_OUT_IFACE_VERSION, "sun", "xine audio output plugin using sun-compliant audio devices/drivers", - 5 + 10 }; ao_info_t *get_audio_out_plugin_info() { diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 3e18c944b..619717545 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: load_plugins.c,v 1.36 2001/08/13 12:52:33 ehasenle Exp $ + * $Id: load_plugins.c,v 1.37 2001/08/14 01:38:17 guenter Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -624,6 +624,8 @@ char **xine_list_audio_output_plugins(void) { char **plugin_ids; int num_plugins = 0; DIR *dir; + int i,j; + int plugin_prios[50]; plugin_ids = (char **) xmalloc (50 * sizeof (char *)); plugin_ids[0] = NULL; @@ -664,17 +666,32 @@ char **xine_list_audio_output_plugins(void) { ao_info_t* (*getinfo) (); ao_info_t *ao_info; - /* printf ("load_plugins: plugin %s successfully loaded.\n", str); */ + /* printf ("load_plugins: plugin %s successfully loaded.\n", str); */ if ((getinfo = dlsym(plugin, "get_audio_out_plugin_info")) != NULL) { ao_info = getinfo(); + /* printf("load_plugins: id=%s, priority=%d\n", ao_info->id, ao_info->priority); */ if ( ao_info->interface_version == AUDIO_OUT_IFACE_VERSION) { - /* FIXME: sort the list by ao_info->priority */ + /* sort the list by ao_info->priority */ + + i = 0; + while ( (ipriorityi) { + plugin_ids[j] = plugin_ids[j-1]; + plugin_prios[j] = plugin_prios[j-1]; + j--; + } + + /*printf("i = %d, id=%s, priority=%d\n", i, ao_info->id, ao_info->priority); */ + plugin_ids[i] = (char *) malloc (strlen(ao_info->id)+1); + strcpy (plugin_ids[i], ao_info->id); + plugin_prios[i] = ao_info->priority; - plugin_ids[num_plugins] = (char *) malloc (strlen(ao_info->id)+1); - strcpy (plugin_ids[num_plugins], ao_info->id); num_plugins++; plugin_ids[num_plugins] = NULL; } -- cgit v1.2.3