summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-12-09 18:03:26 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-12-09 18:03:26 +0000
commitb3bf0f3eda9ebd70d75d3705d33bffa1491a7d3d (patch)
treec088af826b876314cf8fb67f2eeb47763bdeefef /src
parent67f3e9edd2441f934e4efef7fa009c32d3b5d617 (diff)
downloadxine-lib-b3bf0f3eda9ebd70d75d3705d33bffa1491a7d3d.tar.gz
xine-lib-b3bf0f3eda9ebd70d75d3705d33bffa1491a7d3d.tar.bz2
xine error reporting interface, very simple
CVS patchset: 1193 CVS date: 2001/12/09 18:03:26
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/xine.c20
-rw-r--r--src/xine-engine/xine_internal.h17
2 files changed, 29 insertions, 8 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 2be5b9dbc..717adb033 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.87 2001/12/09 17:24:39 guenter Exp $
+ * $Id: xine.c,v 1.88 2001/12/09 18:03:26 guenter Exp $
*
* top-level xine functions
*
@@ -237,7 +237,7 @@ static int find_demuxer(xine_t *this, const char *MRL) {
return 0;
}
-void xine_play (xine_t *this, char *mrl,
+int xine_play (xine_t *this, char *mrl,
int start_pos, int start_time) {
double share ;
@@ -295,8 +295,10 @@ void xine_play (xine_t *this, char *mrl,
if (!this->cur_input_plugin) {
printf ("xine: cannot find input plugin for this MRL\n");
this->cur_demuxer_plugin = NULL;
+ this->err = XINE_ERROR_NO_INPUT_PLUGIN;
pthread_mutex_unlock (&this->xine_lock);
- return;
+
+ return 0;
}
xine_log (this, XINE_LOG_MSG,
@@ -311,8 +313,9 @@ void xine_play (xine_t *this, char *mrl,
if (!find_demuxer(this, mrl)) {
printf ("xine: couldn't find demuxer for >%s<\n", mrl);
+ this->err = XINE_ERROR_NO_DEMUXER_PLUGIN;
pthread_mutex_unlock (&this->xine_lock);
- return;
+ return 0;
}
xine_log (this, XINE_LOG_MSG,
@@ -361,6 +364,8 @@ void xine_play (xine_t *this, char *mrl,
}
pthread_mutex_unlock (&this->xine_lock);
+
+ return 1;
}
int xine_eject (xine_t *this) {
@@ -413,7 +418,8 @@ xine_t *xine_init (vo_driver_t *vo,
printf("xine_init entered\n");
- this->config = config;
+ this->err = XINE_ERROR_NONE;
+ this->config = config;
/* probe for optimized memcpy or config setting */
xine_probe_fast_memcpy(config);
@@ -815,4 +821,6 @@ char **xine_get_log (xine_t *this, int buf) {
}
-
+int xine_get_error (xine_t *this) {
+ return this->err;
+}
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 8921d385d..140db9a71 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.61 2001/12/09 17:24:39 guenter Exp $
+ * $Id: xine_internal.h,v 1.62 2001/12/09 18:03:26 guenter Exp $
*
*/
@@ -223,6 +223,8 @@ struct xine_s {
/* log output that may be presented to the user */
scratch_buffer_t *log_buffers[XINE_LOG_NUM];
+ int err;
+
};
/*
@@ -249,8 +251,9 @@ xine_t *xine_init (vo_driver_t *vo,
* if both parameters are !=0 start_pos will be used
* for non-seekable streams both values will be ignored
*
+ * returns 1 on succ, 0 on failure
*/
-void xine_play (xine_t *this, char *MRL, int start_pos, int start_time);
+int xine_play (xine_t *this, char *MRL, int start_pos, int start_time);
/*
@@ -588,6 +591,16 @@ void xine_log (xine_t *this, int buf, const char *format, ...);
char **xine_get_log (xine_t *this, int buf);
+/*
+ * xine error reporting
+ */
+
+#define XINE_ERROR_NONE 0
+#define XINE_ERROR_NO_INPUT_PLUGIN 1
+#define XINE_ERROR_NO_DEMUXER_PLUGIN 2
+
+int xine_get_error (xine_t *this);
+
#ifdef __cplusplus
}
#endif