[FFmpeg-cvslog] r24090 - trunk/ffplay.c

jai_menon subversion
Wed Jul 7 20:14:59 CEST 2010


Author: jai_menon
Date: Wed Jul  7 20:14:58 2010
New Revision: 24090

Log:
FFplay : Fix segfault when playing monoaural streams.

Modified:
   trunk/ffplay.c

Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c	Wed Jul  7 19:27:51 2010	(r24089)
+++ trunk/ffplay.c	Wed Jul  7 20:14:58 2010	(r24090)
@@ -943,7 +943,8 @@ static void video_audio_display(VideoSta
             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);



More information about the ffmpeg-cvslog mailing list