Mercurial > mplayer.hg
diff gui/win32/gui.c @ 34979:93a763f04563
Fix bug with definition of IDPLAYDISK in Win32 GUI.
Numeric identifiers starting from IDPLAYDISK are used for CDROM/DVD
drive menu entries and there must be enough identifier for all drives
available. Introduce IDPLAYDISK_LIMIT for a range of such identifiers.
Additionally, add a check when creating menu entries and rework the
condition for checking the play command for reasons of clarity.
Reported by Stephen Sheldon, sfsheldo gmail com.
author | ib |
---|---|
date | Sat, 11 Aug 2012 13:02:58 +0000 |
parents | ac6b38cd0d45 |
children | 07b7e8355049 |
line wrap: on
line diff
--- a/gui/win32/gui.c Fri Aug 10 21:12:02 2012 +0000 +++ b/gui/win32/gui.c Sat Aug 11 13:02:58 2012 +0000 @@ -887,7 +887,7 @@ strcat(menuitem, volname); } AppendMenu(gui->diskmenu, flags, IDPLAYDISK + cdromdrive, menuitem); - cdromdrive++; + if (++cdromdrive == IDPLAYDISK_LIMIT - IDPLAYDISK) break; } pos += strlen(device + pos) + 1; } @@ -1029,7 +1029,7 @@ handlemsg(hWnd, evAbout); break; } - if((IDPLAYDISK <= LOWORD(wParam)) && (LOWORD(wParam) < (IDPLAYDISK + 100))) + if(LOWORD(wParam) >= IDPLAYDISK && LOWORD(wParam) < IDPLAYDISK_LIMIT) { char device[MAX_PATH]; char searchpath[MAX_PATH];