From: Thibaut M. <tma...@no...> - 2003-04-13 13:34:27
|
Hi list, Replying to myself, I've modified all the input plugins (except Rocky's ones). The patch is here (77ko) : http://xine.sourceforge.net/tmattern/input_plugins/xine-lib.patch The next step is to add xine_message() calls before every "return 0" in=20 plugin.open() methods. I've started to do this for the http plugin. Next step 2: have all network input plugins to use the same code with=20 select(). Next step 3: must be able to stop engine while waiting for data. (see TODO list) Please comment the patch, i'd like to commit this soon. cheers, thibaut On Wednesday 09 April 2003 01:45, Thibaut Mattern wrote: > Hi, > > Currently, if an input plugin fails to open a stream (due to a network > error for example), xine_open will return a XINE_ERROR_NO_INPUT_PLUGIN > error. I find this a bit confusing. > There is IMHO a little design problem because there is no way to > differentiate an open failure from an unhandled mrl. > That's why I propose to change xine_open() to return a new error > (XINE_ERROR_INPUT_FAILED) if the input plugin really fails to open the > stream. > To achive this I propose to split the current input_pluging.open method in > two parts: > 1) mrl parsing > 2) stream opening > > The following pseudo-code should explain the idea : > > input_*.c: > /* can_handle > * checks if this plugin can handle the given mrl, no xine_message() he= re > * returns > * a valid pointer on a plugin instance or NULL if an error occured > */ > static input_plugin_t *can_handle (input_class_t *cls_gen, xine_stream_t > *stream, const char *mrl) ; > > /* open_plugin > * opens the stream and calls xine_message() if an error occured > * returns > * 0: error > * 1: success > */ > static int open_plugin (input_plugin_t *this_gen, const char *mrl); > > ---------------------------------------- > load_plugin.c: > input_plugin_t *find_input_plugin (xine_stream_t *stream, const char *mrl) > { foreach input_plugin in input_plugin list { > /* no xine_message calls, no blocking stuff */ > if (input.can_handle(mrl)) { > return input; > } > } > return NULL; > } > > ---------------------------------------- > xine.c: > static int xine_open_internal (xine_stream_t *stream, const char *mrl) { > ... > input_plugin =3D find_input_plugin(mrl); > if (!input_plugin) { > /* really a "no input plugin" error */ > stream->err =3D XINE_ERROR_NO_INPUT_PLUGIN; > return 0; > } > > /* input->open() can call xine_message() if an error occured */ > if (input->open(mrl)) { > if (!(stream->demux_plugin=3Dfind_demux_plugin (stream, > stream->input_plugin))) { > stream->err =3D XINE_ERROR_NO_DEMUX_PLUGIN; > stream->status =3D XINE_STATUS_STOP; > return 0; > } > } else { > stream->err =3D XINE_ERROR_INPUT_FAILED; > return 0; > } > ... > } > ---------------------------------------- > > G=FCnter, is there a problem with adding this new error ? > Miguel already told me that he likes this idea. > Comments ? > > cheers, > thibaut > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > xine-devel mailing list > xin...@li... > https://lists.sourceforge.net/lists/listinfo/xine-devel |