[FFmpeg-cvslog] ffplay: set default window size before starting audio

Marton Balint git at videolan.org
Sat Dec 7 18:54:26 CET 2013


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Dec  1 14:21:25 2013 +0100| [ad01fae86d80c8a7ac87f6203d87418b898e62ab] | committer: Marton Balint

ffplay: set default window size before starting audio

Fixes ticket #2381.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad01fae86d80c8a7ac87f6203d87418b898e62ab
---

 ffplay.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 30ee5fd..4893ebc 100644
--- 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) {



More information about the ffmpeg-cvslog mailing list