aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2012-09-01 15:01:29 +0200
committerMarton Balint <cus@passwd.hu>2012-09-11 22:15:37 +0200
commit255c7bb1837cd0cdc454108df9d3fc79cf363bb5 (patch)
treefaefac3e197e88c35c115eaac16252edfde6b11b
parentbd14d845e90f3eca2271c5437698925c6cc38f0c (diff)
downloadffmpeg-255c7bb1837cd0cdc454108df9d3fc79cf363bb5.tar.gz
ffplay: make initial window size calculation based on aspect ratio
Fixes ticket #291. Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--ffplay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffplay.c b/ffplay.c
index a493cbce65..45e23c4407 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -963,6 +963,7 @@ static int video_open(VideoState *is, int force_set_video_mode)
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
int w,h;
VideoPicture *vp = &is->pictq[is->pictq_rindex];
+ SDL_Rect rect;
if (is_full_screen) flags |= SDL_FULLSCREEN;
else flags |= SDL_RESIZABLE;
@@ -974,8 +975,9 @@ static int video_open(VideoState *is, int force_set_video_mode)
w = screen_width;
h = screen_height;
} else if (vp->width) {
- w = vp->width;
- h = vp->height;
+ calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
+ w = rect.w;
+ h = rect.h;
} else {
w = 640;
h = 480;