diff options
author | Jai Menon <jmenon86@gmail.com> | 2010-07-07 22:14:58 +0400 |
---|---|---|
committer | Jai Menon <jmenon86@gmail.com> | 2010-07-07 22:14:58 +0400 |
commit | 00f72577adc7377cc28c46ebef75c18b10bc32e5 (patch) | |
tree | 664941249d00779f0c9290c9cd60e81117874fa2 /ffplay.c | |
parent | 9077e29eccd39fca766aa5b2df843dbb171ec837 (diff) |
FFplay : Fix segfault when playing monoaural streams.
Originally committed as revision 24090 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -943,7 +943,8 @@ static void video_audio_display(VideoState *s) for(y=0; y<s->height; y++){ double w= 1/sqrt(nb_freq); int a= sqrt(w*sqrt(data[0][2*y+0]*data[0][2*y+0] + data[0][2*y+1]*data[0][2*y+1])); - int b= sqrt(w*sqrt(data[1][2*y+0]*data[1][2*y+0] + data[1][2*y+1]*data[1][2*y+1])); + int b= (nb_display_channels == 2 ) ? sqrt(w*sqrt(data[1][2*y+0]*data[1][2*y+0] + + data[1][2*y+1]*data[1][2*y+1])) : a; a= FFMIN(a,255); b= FFMIN(b,255); fgcolor = SDL_MapRGB(screen->format, a, b, (a+b)/2); |