mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
dont use SDL_WM_ToggleFullScreen() as that doesnt seem to work reliably if a SDL_SetVideoMode() is called quickly afterwards
Originally committed as revision 7390 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
cfe9cfede8
commit
fb84155b67
15
ffplay.c
15
ffplay.c
@ -833,12 +833,13 @@ static int video_open(VideoState *is){
|
|||||||
int flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
|
int flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
|
||||||
int w,h;
|
int w,h;
|
||||||
|
|
||||||
|
if(is_full_screen) flags |= SDL_FULLSCREEN;
|
||||||
|
else flags |= SDL_RESIZABLE;
|
||||||
|
|
||||||
if (is_full_screen && fs_screen_width) {
|
if (is_full_screen && fs_screen_width) {
|
||||||
w = fs_screen_width;
|
w = fs_screen_width;
|
||||||
h = fs_screen_height;
|
h = fs_screen_height;
|
||||||
flags |= SDL_FULLSCREEN;
|
} else if(!is_full_screen && screen_width){
|
||||||
} else {
|
|
||||||
if(screen_width){
|
|
||||||
w = screen_width;
|
w = screen_width;
|
||||||
h = screen_height;
|
h = screen_height;
|
||||||
}else if (is->video_st && is->video_st->codec->width){
|
}else if (is->video_st && is->video_st->codec->width){
|
||||||
@ -848,8 +849,6 @@ static int video_open(VideoState *is){
|
|||||||
w = 640;
|
w = 640;
|
||||||
h = 480;
|
h = 480;
|
||||||
}
|
}
|
||||||
flags |= SDL_RESIZABLE;
|
|
||||||
}
|
|
||||||
#ifndef CONFIG_DARWIN
|
#ifndef CONFIG_DARWIN
|
||||||
screen = SDL_SetVideoMode(w, h, 0, flags);
|
screen = SDL_SetVideoMode(w, h, 0, flags);
|
||||||
#else
|
#else
|
||||||
@ -2147,11 +2146,9 @@ static void toggle_full_screen(void)
|
|||||||
is_full_screen = !is_full_screen;
|
is_full_screen = !is_full_screen;
|
||||||
if (!fs_screen_width) {
|
if (!fs_screen_width) {
|
||||||
/* use default SDL method */
|
/* use default SDL method */
|
||||||
SDL_WM_ToggleFullScreen(screen);
|
// SDL_WM_ToggleFullScreen(screen);
|
||||||
} else {
|
|
||||||
/* use the recorded resolution */
|
|
||||||
video_open(cur_stream);
|
|
||||||
}
|
}
|
||||||
|
video_open(cur_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void toggle_pause(void)
|
static void toggle_pause(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user