aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2006-06-14 21:02:55 +0000
committerMåns Rullgård <mans@mansr.com>2006-06-14 21:02:55 +0000
commit29f3b38a916720740716153076dfbae7b0dc6b21 (patch)
tree40482db871012bfef7085468a4724b1528e12668 /ffplay.c
parent4a387d7d3b23c9e66012a02c0e90322bddab8fb5 (diff)
downloadffmpeg-29f3b38a916720740716153076dfbae7b0dc6b21.tar.gz
check for SDL_VideoInfo.current_[wh] availability in configure, and
fall back on SDL_WM_ToggleFullScreen() if not available Originally committed as revision 5477 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/ffplay.c b/ffplay.c
index 030a760ae4..720ce324c9 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2096,19 +2096,25 @@ void toggle_full_screen(void)
{
int w, h, flags;
is_full_screen = !is_full_screen;
- flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
- if (is_full_screen) {
- w = fs_screen_width;
- h = fs_screen_height;
- flags |= SDL_FULLSCREEN;
+ if (!fs_screen_width) {
+ /* use default SDL method */
+ SDL_WM_ToggleFullScreen(screen);
} else {
- w = screen_width;
- h = screen_height;
- flags |= SDL_RESIZABLE;
+ /* use the recorded resolution */
+ flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
+ if (is_full_screen) {
+ w = fs_screen_width;
+ h = fs_screen_height;
+ flags |= SDL_FULLSCREEN;
+ } else {
+ w = screen_width;
+ h = screen_height;
+ flags |= SDL_RESIZABLE;
+ }
+ screen = SDL_SetVideoMode(w, h, 0, flags);
+ cur_stream->width = w;
+ cur_stream->height = h;
}
- screen = SDL_SetVideoMode(w, h, 0, flags);
- cur_stream->width = w;
- cur_stream->height = h;
}
void toggle_pause(void)
@@ -2426,10 +2432,11 @@ int main(int argc, char **argv)
}
if (!display_disable) {
+#ifdef HAVE_SDL_VIDEO_SIZE
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
fs_screen_width = vi->current_w;
fs_screen_height = vi->current_h;
-
+#endif
flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
if (is_full_screen && fs_screen_width) {
w = fs_screen_width;