From d99477f49fb1992494dcafec2b2fa218e0d30c5a Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Thu, 24 Oct 2013 04:35:16 -0700 Subject: [PATCH] Fixed silence detection --- Plugins/HighlyComplete/HighlyComplete/circular_buffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/HighlyComplete/HighlyComplete/circular_buffer.h b/Plugins/HighlyComplete/HighlyComplete/circular_buffer.h index 266b6184a..da0e899dd 100644 --- a/Plugins/HighlyComplete/HighlyComplete/circular_buffer.h +++ b/Plugins/HighlyComplete/HighlyComplete/circular_buffer.h @@ -74,7 +74,7 @@ public: mask = ~mask; if ( used ) { - p = begin = &buffer[ 0 ] + readptr - 1; + p = ( begin = &buffer[ 0 ] + readptr ) - 1; end = &buffer[ 0 ] + ( writeptr > readptr ? writeptr : size ); while ( ++p < end && ( ( unsigned long ) ( *p + silence_threshold ) <= ( unsigned long ) silence_threshold * 2 ) ); unsigned long skipped = ( p - begin ) & mask; @@ -83,7 +83,7 @@ public: readptr = ( readptr + skipped ) % size; if ( readptr == 0 && readptr != writeptr ) { - p = begin = &buffer[ 0 ]; + p = ( begin = &buffer[ 0 ] ) - 1; end = &buffer[ 0 ] + writeptr; while ( ++p < end && ( ( unsigned long ) ( *p + silence_threshold ) <= ( unsigned long ) silence_threshold * 2 ) ); skipped = ( p - begin ) & mask;