10l (fix segfault with audio only files)
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 31 Dec 2006 17:59:10 +0000 (17:59 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 31 Dec 2006 17:59:10 +0000 (17:59 +0000)
Originally committed as revision 7387 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffplay.c

index e0b53bccfde52104ae6bfbcac15dd8e2395d39ee..58247c488fe49aadf18fd9637197b8f50c697f8b 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -829,9 +829,13 @@ static void video_audio_display(VideoState *s)
     SDL_UpdateRect(screen, s->xleft, s->ytop, s->width, s->height);
 }
 
+static int video_open(VideoState *is);
+
 /* display the current picture, if any */
 static void video_display(VideoState *is)
 {
+    if(!screen)
+        video_open(cur_stream);
     if (is->audio_st && is->show_audio)
         video_audio_display(is);
     else if (is->video_st)
@@ -2481,9 +2485,6 @@ int main(int argc, char **argv)
 
     cur_stream = stream_open(input_filename, file_iformat);
 
-    if(video_disable && !display_disable)
-        video_open(cur_stream);
-
     event_loop();
 
     /* never returns */