From: Michael Niedermayer Date: Mon, 29 Jan 2007 22:06:55 +0000 (+0000) Subject: trigger for the audio scope vissualization X-Git-Tag: v0.5~10296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac50bcc834a3d2cee880813424072768f84c6229;p=platform%2Fupstream%2Flibav.git trigger for the audio scope vissualization Originally committed as revision 7761 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/ffplay.c b/ffplay.c index 02f8132..1c3aa63 100644 --- a/ffplay.c +++ b/ffplay.c @@ -782,7 +782,23 @@ static void video_audio_display(VideoState *s) delay -= s->width / 2; if (delay < s->width) delay = s->width; - i_start = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE); + + i_start= x = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE); + + h= INT_MIN; + for(i=0; i<1000; i+=channels){ + int idx= (SAMPLE_ARRAY_SIZE + x - i) % SAMPLE_ARRAY_SIZE; + int a= s->sample_array[idx]; + int b= s->sample_array[(idx + 4*channels)%SAMPLE_ARRAY_SIZE]; + int c= s->sample_array[(idx + 5*channels)%SAMPLE_ARRAY_SIZE]; + int d= s->sample_array[(idx + 9*channels)%SAMPLE_ARRAY_SIZE]; + int score= a-d; + if(hlast_i_start = i_start; } else { i_start = s->last_i_start;