Commit 8d0b8064 authored by Damien Fouilleul's avatar Damien Fouilleul

- log.c: fix for negative message count

parent be5b65c2
...@@ -92,7 +92,10 @@ unsigned libvlc_log_count( const libvlc_log_t *p_log, libvlc_exception_t *p_e ) ...@@ -92,7 +92,10 @@ unsigned libvlc_log_count( const libvlc_log_t *p_log, libvlc_exception_t *p_e )
int i_start = p_log->p_messages->i_start; int i_start = p_log->p_messages->i_start;
int i_stop = *(p_log->p_messages->pi_stop); int i_stop = *(p_log->p_messages->pi_stop);
return (i_stop - i_start) % VLC_MSG_QSIZE; if( i_stop >= i_start )
return i_stop-i_start;
else
return VLC_MSG_QSIZE-(i_start-i_stop);
} }
RAISEZERO("Invalid log object!"); RAISEZERO("Invalid log object!");
} }
......
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