diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-13 23:17:29 +0000 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-13 23:17:29 +0000 |
commit | 1733aa1f8d257417836c86292ee60cd724c7eae2 (patch) | |
tree | 69a17198f7e74fe6ceca4cc95c85efae42d2d4b9 /src | |
parent | 31e71bd6ac7973b89490648fe663bd9a2ec0307d (diff) | |
download | xine-lib-1733aa1f8d257417836c86292ee60cd724c7eae2.tar.gz xine-lib-1733aa1f8d257417836c86292ee60cd724c7eae2.tar.bz2 |
Allow the input plugins to file in a proper way when they can handle the input requested, but simply fails because of connection failures or unaccessible files, by returning -1. Leave the same meaning to the old 0 and 1 values.
CVS patchset: 8231
CVS date: 2006/09/13 23:17:29
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/xine.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 5b7bdd24d..e37ce2ee7 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.331 2006/09/10 19:50:09 dgp85 Exp $ + * $Id: xine.c,v 1.332 2006/09/13 23:17:29 dgp85 Exp $ */ /* @@ -727,6 +727,8 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { */ if ((stream->input_plugin = _x_find_input_plugin (stream, input_source))) { + int res; + xine_log (stream->xine, XINE_LOG_MSG, _("xine: found input plugin : %s\n"), stream->input_plugin->input_class->get_description(stream->input_plugin->input_class)); if (stream->input_plugin->input_class->eject_media) @@ -734,15 +736,23 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { _x_meta_info_set_utf8(stream, XINE_META_INFO_INPUT_PLUGIN, (stream->input_plugin->input_class->get_identifier (stream->input_plugin->input_class))); - if (!stream->input_plugin->open(stream->input_plugin)) { + res = stream->input_plugin->open(stream->input_plugin); + switch(res) { + case 1: /* Open successfull */ + free(input_source); + break; + case -1: /* Open unsuccessfull, but correct plugin */ + free(input_source); + stream->err = XINE_ERROR_INPUT_FAILED; + _x_flush_events_queues (stream); + return 0; + default: xine_log (stream->xine, XINE_LOG_MSG, _("xine: input plugin cannot open MRL [%s]\n"),mrl); stream->input_plugin->dispose(stream->input_plugin); stream->input_plugin = NULL; stream->err = XINE_ERROR_INPUT_FAILED; - } else { - free(input_source); - break; } + if ( res ) break; } free(input_source); |