From: Darren S. <li...@yo...> - 2008-06-11 18:38:35
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1213207864 -3600 # Node ID c43660485c68d2573fa8f69c1131cbd16774518b # Parent dc8f9c98ad2719b28260603aaa77886c5c66e362 Provide a useful implementation of xine_register_log_cb(). diff -r c43660485c68d2573fa8f69c1131cbd16774518b -r dc8f9c98ad2719b28260603aaa77886c5c66e362 ChangeLog --- a/ChangeLog Wed Jun 11 19:11:04 2008 +0100 +++ b/ChangeLog Wed Jun 11 18:19:51 2008 +0100 @@ -9,6 +9,7 @@ xine-lib (1.1.12.1) 2008-??-?? * Fixed display of some MJPEG streams (YUVJ420P). * Deprecate xine_xmalloc() function, see src/xine-utils/utils.c for more information about the reason. + * Provide a useful implementation of xine_register_log_cb(). xine-lib (1.1.12) 2008-04-14 * Security fixes: diff -r c43660485c68d2573fa8f69c1131cbd16774518b -r dc8f9c98ad2719b28260603aaa77886c5c66e362 src/xine-engine/xine.c --- a/src/xine-engine/xine.c Wed Jun 11 19:11:04 2008 +0100 +++ b/src/xine-engine/xine.c Wed Jun 11 18:19:51 2008 +0100 @@ -2229,7 +2229,10 @@ void xine_log (xine_t *this, int buf, co 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, co 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,11 +2258,9 @@ char *const *xine_get_log (xine_t *this, } 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; diff -r c43660485c68d2573fa8f69c1131cbd16774518b -r dc8f9c98ad2719b28260603aaa77886c5c66e362 src/xine-engine/xine_internal.h --- a/src/xine-engine/xine_internal.h Wed Jun 11 19:11:04 2008 +0100 +++ b/src/xine-engine/xine_internal.h Wed Jun 11 18:19:51 2008 +0100 @@ -117,6 +117,9 @@ struct xine_s { #ifdef XINE_ENGINE_INTERNAL xine_ticket_t *port_ticket; pthread_mutex_t log_lock; + + xine_log_cb_t log_cb; + void *log_cb_user_data; #endif }; |