changeset 36287:3a1b89dc7070

Place GUI_HANDLE_EVENTS calls after GUI_REDRAW calls. The redraw will generate events, which should be handled afterwards (if already in the event queue).
author ib
date Thu, 01 Aug 2013 17:12:26 +0000
parents 428bd1b127bd
children 63e8bfb208c6
files mplayer.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Thu Aug 01 17:10:10 2013 +0000
+++ b/mplayer.c	Thu Aug 01 17:12:26 2013 +0000
@@ -2564,8 +2564,8 @@
             mpctx->video_out->check_events();
 #ifdef CONFIG_GUI
         if (use_gui) {
+            gui(GUI_REDRAW, 0);
             gui(GUI_HANDLE_EVENTS, 0);
-            gui(GUI_REDRAW, 0);
             if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos))
                 break;
         }
@@ -3095,8 +3095,8 @@
         while (guiInfo.Playing != GUI_PLAY) {
             mp_cmd_t *cmd;
             usec_sleep(20000);
+            gui(GUI_REDRAW, 0);
             gui(GUI_HANDLE_EVENTS, 0);
-            gui(GUI_REDRAW, 0);
             if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) {
                 if (cmd->id == MP_CMD_GUI)
                     gui(GUI_RUN_MESSAGE, cmd->args[0].v.s);
@@ -3996,7 +3996,6 @@
 
 #ifdef CONFIG_GUI
             if (use_gui) {
-                gui(GUI_HANDLE_EVENTS, 0);
                 if (mpctx->demuxer->file_format == DEMUXER_TYPE_AVI && mpctx->sh_video && mpctx->sh_video->video.dwLength > 2) {
                     // get pos from frame number / total frames
                     guiInfo.Position = (float)mpctx->d_video->pack_no * 100.0f / mpctx->sh_video->video.dwLength;
@@ -4010,6 +4009,7 @@
                 guiInfo.RunningTime = demuxer_get_time_length(mpctx->demuxer);
                 gui(GUI_SET_MIXER, 0);
                 gui(GUI_REDRAW, 0);
+                gui(GUI_HANDLE_EVENTS, 0);
                 if (guiInfo.Playing == GUI_STOP)
                     break;                  // STOP
                 if (guiInfo.Playing == GUI_PAUSE)