summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-12-31 20:04:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-12-31 20:04:08 +0000
commitfb84155b67c4351b2bcea72975cb59d50bfc8dea (patch)
treef13da22885bec00cd7781dfc678daa9cf790cd7b /ffplay.c
parentcfe9cfede815dc8212b7be637d7253e5ff8a40ed (diff)
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
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/ffplay.c b/ffplay.c
index 7aab007492..2db802d005 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -833,22 +833,21 @@ static int video_open(VideoState *is){
int flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
int w,h;
+ if(is_full_screen) flags |= SDL_FULLSCREEN;
+ else flags |= SDL_RESIZABLE;
+
if (is_full_screen && fs_screen_width) {
w = fs_screen_width;
h = fs_screen_height;
- flags |= SDL_FULLSCREEN;
+ } else if(!is_full_screen && screen_width){
+ w = screen_width;
+ h = screen_height;
+ }else if (is->video_st && is->video_st->codec->width){
+ w = is->video_st->codec->width;
+ h = is->video_st->codec->height;
} else {
- if(screen_width){
- w = screen_width;
- h = screen_height;
- }else if (is->video_st && is->video_st->codec->width){
- w = is->video_st->codec->width;
- h = is->video_st->codec->height;
- } else {
- w = 640;
- h = 480;
- }
- flags |= SDL_RESIZABLE;
+ w = 640;
+ h = 480;
}
#ifndef CONFIG_DARWIN
screen = SDL_SetVideoMode(w, h, 0, flags);
@@ -2147,11 +2146,9 @@ static void toggle_full_screen(void)
is_full_screen = !is_full_screen;
if (!fs_screen_width) {
/* use default SDL method */
- SDL_WM_ToggleFullScreen(screen);
- } else {
- /* use the recorded resolution */
- video_open(cur_stream);
+// SDL_WM_ToggleFullScreen(screen);
}
+ video_open(cur_stream);
}
static void toggle_pause(void)