Give only once the same PCM buffer to projectM.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 13 Dec 2009 12:22:05 +0000 (13:22 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 13 Dec 2009 12:52:37 +0000 (13:52 +0100)
modules/visualization/projectm.cpp

index 42475fd..2e173b3 100644 (file)
@@ -335,9 +335,11 @@ static void *Thread( void *p_data )
         /* Render the image and swap the buffers */
         vlc_mutex_lock( &p_sys->lock );
         if( p_sys->i_nb_samples > 0 )
+        {
             p_sys->p_projectm->pcm()->addPCMfloat( p_sys->p_buffer,
                                                    p_sys->i_nb_samples );
-
+            p_sys->i_nb_samples = 0;
+        }
         p_sys->p_projectm->renderFrame();
         vlc_mutex_unlock( &p_sys->lock );