On Fri, 19 Sep 2014, Jeff Dwork wrote:

On MS Windows, 'ffplay.exe -fs' does not start fullscreen. Behavior on linux is correct.

On Windows, the initial placement of the SDL screen triggers the SDL_VIDEORESIZE event. This executes the code in the event_loop which calls SDL_SetVideoMode with the SDL_RESIZEABLE bit set. On linux the resize event does not occur.

I can see an obvious flicker on my laptop as the initial fullscreen window is replaced by the normal window. I don't see it on my faster desktop system.

The fix is simple - don't execute SDL_SetVideoMode in the event_loop if is_full_screen is set.
Diff for ffplay version N-66289-gb76d613

diff original/ffplay.c fixed/ffplay.c
3469,3470c3469,3471
< screen = SDL_SetVideoMode(FFMIN(16383, event.resize.w), event.resize.h, 0,
< SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
---
                if (!is_full_screen)
screen = SDL_SetVideoMode(FFMIN(16383, event.resize.w),
event.resize.h, 0,
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);


I'd rather fix this a bit differently, could you please try the attached patch?

Thanks,
Marton
From 61a4f0b2c0ecd883022f06c3655d0f4f936c8615 Mon Sep 17 00:00:00 2001
From: Marton Balint <c...@passwd.hu>
Date: Mon, 22 Sep 2014 22:17:06 +0200
Subject: [PATCH] ffplay: handle fullscreen status on resize event

---
 ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 9982474..310dd75 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3467,7 +3467,7 @@ static void event_loop(VideoState *cur_stream)
             break;
         case SDL_VIDEORESIZE:
                 screen = SDL_SetVideoMode(FFMIN(16383, event.resize.w), event.resize.h, 0,
-                                          SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
+                                          SDL_HWSURFACE|(is_full_screen?SDL_FULLSCREEN:SDL_RESIZABLE)|SDL_ASYNCBLIT|SDL_HWACCEL);
                 if (!screen) {
                     av_log(NULL, AV_LOG_FATAL, "Failed to set video mode\n");
                     do_exit(cur_stream);
-- 
1.8.4.5

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to