From 281d2f5ebe47b9b0cad4c5167f63d38a47a5f64f Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Mon, 22 Oct 2001 17:10:20 +0000 Subject: added xine_is_stream_seekable function, minor code cleanups CVS patchset: 858 CVS date: 2001/10/22 17:10:20 --- src/xine-engine/load_plugins.c | 123 +++++++++++++++++++++------------------- src/xine-engine/xine.c | 8 ++- src/xine-engine/xine_internal.h | 8 ++- 3 files changed, 78 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index d533bd01d..73598c9af 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.45 2001/10/20 02:01:51 guenter Exp $ + * $Id: load_plugins.c,v 1.46 2001/10/22 17:10:20 guenter Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -362,31 +362,33 @@ void load_decoder_plugins (xine_t *this, str, dlerror()); } else { - void *(*initplug) (int, config_values_t *); int plugin_prio; /* * does this plugin provide an spu decoder plugin? */ - - if((initplug = dlsym(plugin, "init_spu_decoder_plugin")) != NULL) { - - spu_decoder_t *sdp; - int streamtype; - - sdp = (spu_decoder_t *) initplug(4, this); - if (sdp) { - sdp->metronom = this->metronom; - - for (streamtype = 0; streamtypespu_decoder_plugins[streamtype] = sdp; - spu_prio[streamtype] = plugin_prio; - } + { + void *(*initplug) (int, xine_t *); + + if((initplug = dlsym(plugin, "init_spu_decoder_plugin")) != NULL) { - printf("spu decoder plugin found : %s\n", - sdp->get_identifier()); + spu_decoder_t *sdp; + int streamtype; + + sdp = (spu_decoder_t *) initplug(4, this); + if (sdp) { + sdp->metronom = this->metronom; + + for (streamtype = 0; streamtypespu_decoder_plugins[streamtype] = sdp; + spu_prio[streamtype] = plugin_prio; + } + + printf("spu decoder plugin found : %s\n", + sdp->get_identifier()); + } } } @@ -394,51 +396,54 @@ void load_decoder_plugins (xine_t *this, * does this plugin provide an video decoder plugin? */ - if((initplug = dlsym(plugin, "init_video_decoder_plugin")) != NULL) { - - video_decoder_t *vdp; - int streamtype; + { + void *(*initplug) (int, config_values_t *); + if((initplug = dlsym(plugin, "init_video_decoder_plugin")) != NULL) { - vdp = (video_decoder_t *) initplug(iface_version, config); - if (vdp) { - vdp->metronom = this->metronom; - - for (streamtype = 0; streamtypevideo_decoder_plugins[streamtype] = vdp; - video_prio[streamtype] = plugin_prio; - } - - printf("video decoder plugin found : %s\n", - vdp->get_identifier()); - } - } - - /* - * does this plugin provide an audio decoder plugin? - */ - - if((initplug = dlsym(plugin, "init_audio_decoder_plugin")) != NULL) { - - audio_decoder_t *adp; - int streamtype; + video_decoder_t *vdp; + int streamtype; - adp = (audio_decoder_t *) initplug(iface_version, config); - if (adp) { + vdp = (video_decoder_t *) initplug(iface_version, config); + if (vdp) { + vdp->metronom = this->metronom; + + for (streamtype = 0; streamtypevideo_decoder_plugins[streamtype] = vdp; + video_prio[streamtype] = plugin_prio; + } + + printf("video decoder plugin found : %s\n", + vdp->get_identifier()); + } + } - for (streamtype = 0; streamtypeaudio_decoder_plugins[streamtype] = adp; - audio_prio[streamtype] = plugin_prio; - } + /* + * does this plugin provide an audio decoder plugin? + */ + + if((initplug = dlsym(plugin, "init_audio_decoder_plugin")) != NULL) { - printf("audio decoder plugin found : %s\n", - adp->get_identifier()); + audio_decoder_t *adp; + int streamtype; + + adp = (audio_decoder_t *) initplug(iface_version, config); + if (adp) { + + for (streamtype = 0; streamtypeaudio_decoder_plugins[streamtype] = adp; + audio_prio[streamtype] = plugin_prio; + } + + printf("audio decoder plugin found : %s\n", + adp->get_identifier()); + } } + } - } } } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 694729a66..40164625b 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.71 2001/10/20 22:18:59 miguelfreitas Exp $ + * $Id: xine.c,v 1.72 2001/10/22 17:10:21 guenter Exp $ * * top-level xine functions * @@ -671,3 +671,9 @@ void xine_get_audio_lang (xine_t *this, char *str) { } +int xine_is_stream_seekable (xine_t *this) { + + if (this->cur_input_plugin) + return this->cur_input_plugin->get_capabilities (this->cur_input_plugin) & INPUT_CAP_SEEKABLE; + return 0; +} diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 8582793b1..9985d521e 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -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_internal.h,v 1.51 2001/10/20 02:01:51 guenter Exp $ + * $Id: xine_internal.h,v 1.52 2001/10/22 17:10:21 guenter Exp $ * */ @@ -317,6 +317,12 @@ void xine_select_spu_channel (xine_t *this, int channel); */ void xine_get_spu_lang (xine_t *this, char *str); +/* + * check if the stream is seekable (at the moment) + */ + +int xine_is_stream_seekable (xine_t *this); + /* * exit xine */ -- cgit v1.2.3