[MPlayer-cvslog] r34413 - trunk/gui/win32/gui.c

ib subversion at mplayerhq.hu
Thu Dec 8 20:41:29 CET 2011


Author: ib
Date: Thu Dec  8 20:41:28 2011
New Revision: 34413

Log:
Fix bug in Win32 GUI introduced in r34403.

When selecting a file to open in the open dialog, the open dialog just
reappears.

handlemsg() passes unknown messages (such as evDropFile) to the gui's
playercontrol function (guiSetEvent()). We cannot replace the
handlemsg(hWnd, evDropFile) call by handlemsg(hWnd, evLoadPlay), because
evLoadPlay is known in handlemsg() and has a different meaning there. So
we directly call gui->playercontrol(evLoadPlay) instead where evDropFile
and evLoadPlay have the same meaning.

Reported by Stephen Sheldon, sfsheldo gmail com.

Modified:
   trunk/gui/win32/gui.c

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Thu Dec  8 18:11:52 2011	(r34412)
+++ trunk/gui/win32/gui.c	Thu Dec  8 20:41:28 2011	(r34413)
@@ -238,7 +238,7 @@ static void handlemsg(HWND hWnd, int msg
         case evLoadPlay:
         case evLoad:
             if(display_openfilewindow(gui, 0) && (msg == evLoadPlay))
-                handlemsg(hWnd, evLoadPlay);
+                gui->playercontrol(evLoadPlay);
             return;
         case evLoadSubtitle:
             display_opensubtitlewindow(gui);
@@ -501,13 +501,13 @@ static LRESULT CALLBACK SubProc(HWND hWn
                         gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0);
                 }
                 DragFinish((HDROP) wParam);
-                handlemsg(hWnd, evLoadPlay);
+                gui->playercontrol(evLoadPlay);
             }
             else
             {
                 gui->playlist->clear_playlist(gui->playlist);
                 gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0);
-                handlemsg(hWnd, evLoadPlay);
+                gui->playercontrol(evLoadPlay);
             }
             SetForegroundWindow(gui->subwindow);
             return 0;
@@ -790,13 +790,13 @@ static LRESULT CALLBACK EventProc(HWND h
                         gui->playlist->add_track(gui->playlist, file, NULL, NULL, 0);
                 }
                 DragFinish((HDROP) wParam);
-                handlemsg(hWnd, evLoadPlay);
+                gui->playercontrol(evLoadPlay);
             }
             else
             {
                 gui->playlist->clear_playlist(gui->playlist);
                 gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0);
-                handlemsg(hWnd, evLoadPlay);
+                gui->playercontrol(evLoadPlay);
             }
             SetForegroundWindow(gui->mainwindow);
             return 0;
@@ -1118,7 +1118,7 @@ static LRESULT CALLBACK EventProc(HWND h
 
 static void startplay(gui_t *gui)
 {
-    handlemsg(gui->mainwindow, evLoadPlay);
+    gui->playercontrol(evLoadPlay);
 }
 
 /* returns the bits per pixel of the desktop */


More information about the MPlayer-cvslog mailing list