- if( p_log )
- {
- unsigned ret;
-
- /* We cannot lock due to pointer constraints.
- * Even then, this would not be thread safe anyway. */
- /*vlc_spin_lock (&p_log->data.lock);*/
- ret = p_log->data.count;
- /*vlc_spin_unlock (&p_log->data.lock);*/
- return ret;
- }
- RAISEZERO("Invalid log object!");
+ if( !p_log )
+ return 0;
+
+ msg_cb_data_t *data = &((libvlc_log_t *)p_log)->data;
+ unsigned ret;
+
+ /* We cannot lock due to constant pointer constraints. Break them.
+ * Even then, this si not really thread safe anyway. */
+ vlc_spin_lock (&data->lock);
+ ret = data->count;
+ vlc_spin_unlock (&data->lock);
+ return ret;