mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
ffplay: factor out function setting default window size
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
eff4820eb2
commit
2b377fb4c0
16
ffplay.c
16
ffplay.c
@ -1066,20 +1066,24 @@ static void sigterm_handler(int sig)
|
|||||||
exit(123);
|
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)
|
static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp)
|
||||||
{
|
{
|
||||||
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
|
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
|
||||||
int w,h;
|
int w,h;
|
||||||
SDL_Rect rect;
|
|
||||||
|
|
||||||
if (is_full_screen) flags |= SDL_FULLSCREEN;
|
if (is_full_screen) flags |= SDL_FULLSCREEN;
|
||||||
else flags |= SDL_RESIZABLE;
|
else flags |= SDL_RESIZABLE;
|
||||||
|
|
||||||
if (vp && vp->width) {
|
if (vp && vp->width)
|
||||||
calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
|
set_default_window_size(vp);
|
||||||
default_width = rect.w;
|
|
||||||
default_height = rect.h;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_full_screen && fs_screen_width) {
|
if (is_full_screen && fs_screen_width) {
|
||||||
w = fs_screen_width;
|
w = fs_screen_width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user