diff options
author | Marton Balint <cus@passwd.hu> | 2013-12-01 13:25:05 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2013-12-06 19:57:45 +0100 |
commit | 2b377fb4c0539dc50b417be98e9ca78c85697520 (patch) | |
tree | f770229a711b83fb019851ccc660e0f3d74af619 /ffplay.c | |
parent | eff4820eb20400926649edd61962b5d349489e70 (diff) | |
download | ffmpeg-2b377fb4c0539dc50b417be98e9ca78c85697520.tar.gz |
ffplay: factor out function setting default window size
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -1066,20 +1066,24 @@ static void sigterm_handler(int sig) exit(123); } +static void set_default_window_size(VideoPicture *vp) +{ + SDL_Rect rect; + calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp); + default_width = rect.w; + default_height = rect.h; +} + static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp) { int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL; int w,h; - SDL_Rect rect; if (is_full_screen) flags |= SDL_FULLSCREEN; else flags |= SDL_RESIZABLE; - if (vp && vp->width) { - calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp); - default_width = rect.w; - default_height = rect.h; - } + if (vp && vp->width) + set_default_window_size(vp); if (is_full_screen && fs_screen_width) { w = fs_screen_width; |