Commit 9f176200 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Update message callback

 - remove always zero overruns counter,
 - constify message pointer.
parent 1075ddb2
......@@ -117,7 +117,7 @@ typedef struct msg_cb_data_t msg_cb_data_t;
* Message logging callback signature.
* Accepts one private data pointer, the message, and an overrun counter.
*/
typedef void (*msg_callback_t) (msg_cb_data_t *, msg_item_t *, unsigned);
typedef void (*msg_callback_t) (msg_cb_data_t *, const msg_item_t *);
VLC_API msg_subscription_t* msg_Subscribe( libvlc_int_t *, msg_callback_t, msg_cb_data_t * ) VLC_USED;
VLC_API void msg_Unsubscribe( msg_subscription_t * );
......
......@@ -71,7 +71,7 @@ static void updateProgressPanel (void *, const char *, float);
static bool checkProgressPanel (void *);
static void destroyProgressPanel (void *);
static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
static void MsgCallback( msg_cb_data_t *, const msg_item_t * );
#pragma mark -
#pragma mark VLC Interface Object Callbacks
......@@ -153,7 +153,7 @@ static void Run( intf_thread_t *p_intf )
* ready to be displayed. We store everything in a NSArray in our Cocoa part
* of this file, so we are forwarding everything through notifications.
*****************************************************************************/
static void MsgCallback( msg_cb_data_t *data, msg_item_t *item, unsigned int i )
static void MsgCallback( msg_cb_data_t *data, const msg_item_t *item )
{
int canc = vlc_savecancel();
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
......
......@@ -1773,10 +1773,9 @@ static void HandleKey(intf_thread_t *p_intf)
*
*/
static void MsgCallback(msg_cb_data_t *data, msg_item_t *msg, unsigned i)
static void MsgCallback(msg_cb_data_t *data, const msg_item_t *msg)
{
intf_sys_t *p_sys = data->p_sys;
(void)i; // what is this?
int canc = vlc_savecancel();
vlc_mutex_lock(&p_sys->msg_lock);
......
......@@ -73,7 +73,7 @@ struct msg_cb_data_t
MessagesDialog *self;
};
static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
static void MsgCallback( msg_cb_data_t *, const msg_item_t * );
MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
: QVLCFrame( _p_intf )
......@@ -296,7 +296,7 @@ void MessagesDialog::tabChanged( int i )
updateButton->setVisible( i == 1 );
}
static void MsgCallback( msg_cb_data_t *data, msg_item_t *item, unsigned )
static void MsgCallback( msg_cb_data_t *data, const msg_item_t *item )
{
int canc = vlc_savecancel();
......@@ -304,4 +304,3 @@ static void MsgCallback( msg_cb_data_t *data, msg_item_t *item, unsigned )
vlc_restorecancel( canc );
}
......@@ -94,7 +94,7 @@ struct intf_sys_t
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overruns);
static void Overflow (msg_cb_data_t *p_sys, const msg_item_t *p_item);
static void TextPrint ( const msg_item_t *, FILE * );
static void HtmlPrint ( const msg_item_t *, FILE * );
#ifdef HAVE_SYSLOG_H
......@@ -366,9 +366,8 @@ static void Close( vlc_object_t *p_this )
/**
* Log a message
*/
static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overruns)
static void Overflow (msg_cb_data_t *p_sys, const msg_item_t *p_item)
{
VLC_UNUSED(overruns);
int verbosity = var_InheritInteger( p_sys->p_intf, "log-verbose" );
if (verbosity == -1)
verbosity = var_InheritInteger( p_sys->p_intf, "verbose" );
......
......@@ -48,7 +48,7 @@ struct msg_cb_data_t
int verbosity;
};
static void handler( msg_cb_data_t *d, msg_item_t *p_item, unsigned i_drop )
static void handler( msg_cb_data_t *d, const msg_item_t *p_item )
{
if (p_item->i_type > d->verbosity)
return;
......@@ -59,7 +59,6 @@ static void handler( msg_cb_data_t *d, msg_item_t *p_item, unsigned i_drop )
if (d->count < VLC_MSG_QSIZE)
d->items[d->count++] = msg;
vlc_spin_unlock (&d->lock);
(void)i_drop;
}
struct libvlc_log_t
......
......@@ -413,7 +413,7 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
break;
}
sub->func (sub->opaque, &msg, 0);
sub->func (sub->opaque, &msg);
}
vlc_rwlock_unlock (&bank->lock);
free (msg.psz_msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment