]> git.sesse.net Git - vlc/blobdiff - src/control/log.c
Removes trailing spaces. Removes tabs.
[vlc] / src / control / log.c
index 93d000c62c4b905576bb2761d2a90a1e5065d430..18a2bbf8c550e4492541bbcbb8159b44101b9aca 100644 (file)
@@ -22,7 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <libvlc_internal.h>
+#include "libvlc_internal.h"
 #include <vlc/libvlc.h>
 
 struct libvlc_log_t
@@ -60,7 +60,7 @@ void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level, li
 
 libvlc_log_t *libvlc_log_open( const libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
 {
-    
     struct libvlc_log_t *p_log =
         (struct libvlc_log_t *)malloc(sizeof(struct libvlc_log_t));
 
@@ -91,8 +91,11 @@ 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_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!");
 }