ffplay: set default window size before starting audio
authorMarton Balint <cus@passwd.hu>
Sun, 1 Dec 2013 13:21:25 +0000 (14:21 +0100)
committerMarton Balint <cus@passwd.hu>
Fri, 6 Dec 2013 18:57:45 +0000 (19:57 +0100)
Fixes ticket #2381.

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index 30ee5fd..4893ebc 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2818,6 +2818,13 @@ static int read_thread(void *arg)
     }
 
     is->show_mode = show_mode;
+    if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) {
+        AVStream *st = ic->streams[st_index[AVMEDIA_TYPE_VIDEO]];
+        AVCodecContext *avctx = st->codec;
+        VideoPicture vp = {.width = avctx->width, .height = avctx->height, .sar = av_guess_sample_aspect_ratio(ic, st, NULL)};
+        if (vp.width)
+            set_default_window_size(&vp);
+    }
 
     /* open the streams */
     if (st_index[AVMEDIA_TYPE_AUDIO] >= 0) {