diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-11-23 10:56:23 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-11-23 10:56:23 +0000 |
commit | e768b907d28d4adfef35230ebf0c7c35d8519235 (patch) | |
tree | f09a8307aab9981322658be864deb6b6fe260801 | |
parent | e4eee84ae9e52bc1fac8a80ec72ddb5bac859fdb (diff) | |
download | xine-lib-e768b907d28d4adfef35230ebf0c7c35d8519235.tar.gz xine-lib-e768b907d28d4adfef35230ebf0c7c35d8519235.tar.bz2 |
fix segfaults with failed drivers
({ao,vo}_new_port would be called with a NULL driver)
CVS patchset: 3349
CVS date: 2002/11/23 10:56:23
-rw-r--r-- | src/xine-engine/load_plugins.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 5a82607a7..77132277d 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.114 2002/11/20 11:57:49 mroi Exp $ + * $Id: load_plugins.c,v 1.115 2002/11/23 10:56:23 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -891,11 +891,13 @@ xine_video_port_t *xine_open_video_driver (xine_t *this, node = xine_list_next_content (catalog->vout); } - if (!driver) - printf ("load_plugins: failed to load video output plugin <%s>\n", id); - pthread_mutex_unlock (&catalog->lock); + if (!driver) { + printf ("load_plugins: failed to load video output plugin <%s>\n", id); + return NULL; + } + port = vo_new_port(this, driver); return port; @@ -1031,15 +1033,16 @@ xine_audio_port_t *xine_open_audio_driver (xine_t *this, const char *id, node = xine_list_next_content (this->plugin_catalog->aout); } + pthread_mutex_unlock (&catalog->lock); + if (!driver) { if (id) printf ("load_plugins: failed to load audio output plugin <%s>\n", id); else printf ("load_plugins: audio output auto-probing didn't find any usable audio driver.\n"); + return NULL; } - pthread_mutex_unlock (&catalog->lock); - port = ao_new_port(this, driver); return port; |