Browse code

Fix some apparent +- errors in the audio vissualization. The bugs become only vissible at higher time resolution than what is used currently.

Originally committed as revision 22442 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2010/03/11 07:43:23
Showing 1 changed files
... ...
@@ -828,10 +828,10 @@ static void video_audio_display(VideoState *s)
828 828
            the last buffer computation */
829 829
         if (audio_callback_time) {
830 830
             time_diff = av_gettime() - audio_callback_time;
831
-            delay += (time_diff * s->audio_st->codec->sample_rate) / 1000000;
831
+            delay -= (time_diff * s->audio_st->codec->sample_rate) / 1000000;
832 832
         }
833 833
 
834
-        delay -= data_used / 2;
834
+        delay += 2*data_used;
835 835
         if (delay < data_used)
836 836
             delay = data_used;
837 837