summaryrefslogtreecommitdiff
path: root/src/xine-engine/xine.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-06-11 19:11:04 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-06-11 19:11:04 +0100
commitacc0fe7a56ffdfa0ca359ba4a18fe7381933dbc5 (patch)
treefdbc0bd63e09253ce503e50ce8cc194d812632ba /src/xine-engine/xine.c
parentabf81e0f348655b62a3e784572c269aab5c8e352 (diff)
downloadxine-lib-acc0fe7a56ffdfa0ca359ba4a18fe7381933dbc5.tar.gz
xine-lib-acc0fe7a56ffdfa0ca359ba4a18fe7381933dbc5.tar.bz2
Provide a useful implementation of xine_register_log_cb().
Diffstat (limited to 'src/xine-engine/xine.c')
-rw-r--r--src/xine-engine/xine.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 46d3b424f..984b6ade9 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -2229,7 +2229,10 @@ void xine_log (xine_t *this, int buf, const char *format, ...) {
vsnprintf(buffer, SCRATCH_LINE_LEN_MAX, format, argp);
printf("%s", buffer);
va_end (argp);
- }
+ }
+
+ if (this->log_cb)
+ this->log_cb (this->log_cb_user_data, buf);
}
void xine_vlog(xine_t *this, int buf, const char *format,
@@ -2238,6 +2241,9 @@ void xine_vlog(xine_t *this, int buf, const char *format,
check_log_alloc (this, buf);
this->log_buffers[buf]->scratch_printf(this->log_buffers[buf], format, args);
+
+ if (this->log_cb)
+ this->log_cb (this->log_cb_user_data, buf);
}
char *const *xine_get_log (xine_t *this, int buf) {
@@ -2252,12 +2258,10 @@ char *const *xine_get_log (xine_t *this, int buf) {
}
void xine_register_log_cb (xine_t *this, xine_log_cb_t cb, void *user_data) {
-
- printf ("xine: xine_register_log_cb: not implemented yet.\n");
- _x_abort();
+ this->log_cb = cb;
+ this->log_cb_user_data = user_data;
}
-
int xine_get_error (xine_stream_t *stream) {
return stream->err;
}