Author: akhaldi
Date: Sat Mar 14 12:05:49 2015
New Revision: 66687
URL:
http://svn.reactos.org/svn/reactos?rev=66687&view=rev
Log:
[MPLAY32] Remove szPrevFile and related code without removing the part that invokes the
file open dialog if playback is started when no media file is opened. By Ricardo Hanke.
CORE-8477
Modified:
trunk/reactos/base/applications/mplay32/mplay32.c
Modified: trunk/reactos/base/applications/mplay32/mplay32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Sat Mar 14 12:05:49
2015
@@ -18,7 +18,6 @@
HMENU hMainMenu = NULL;
TCHAR szAppTitle[256] = _T("");
-TCHAR szPrevFile[MAX_PATH] = _T("");
TCHAR szDefaultFilter[MAX_PATH] = _T("");
TCHAR *szFilter = NULL;
@@ -429,7 +428,6 @@
MaxFilePos = mciStatus.dwReturn;
wDeviceId = mciOpen.wDeviceID;
- StringCbCopy(szPrevFile, sizeof(szPrevFile), lpFileName);
EnableMenuItems(hwnd);
@@ -689,27 +687,14 @@
OpenMediaFile(HWND hwnd, LPTSTR lpFileName)
{
MCIERROR mciError;
- TCHAR szLocalFileName[MAX_PATH];
-
- if (lpFileName == NULL)
- {
- if (szPrevFile[0] == _T('\0'))
- return;
-
- StringCbCopy(szLocalFileName, sizeof(szLocalFileName), szPrevFile);
- }
- else
- {
- StringCbCopy(szLocalFileName, sizeof(szLocalFileName), lpFileName);
- }
-
- if (GetFileAttributes(szLocalFileName) == INVALID_FILE_ATTRIBUTES)
+
+ if (GetFileAttributes(lpFileName) == INVALID_FILE_ATTRIBUTES)
return;
if (wDeviceId)
CloseMediaFile(hwnd);
- mciError = OpenMciDevice(hwnd, NULL, szLocalFileName);
+ mciError = OpenMciDevice(hwnd, NULL, lpFileName);
if (mciError != 0)
{
ShowMCIError(hwnd, mciError);
@@ -1103,10 +1088,7 @@
}
else
{
- if (szPrevFile[0] == _T('\0'))
- OpenFileDialog(hwnd);
- else
- OpenMediaFile(hwnd, NULL);
+ OpenFileDialog(hwnd);
}
break;
}
@@ -1137,7 +1119,6 @@
return 0;
case IDM_CLOSE_FILE:
- szPrevFile[0] = _T('\0');
CloseMediaFile(hwnd);
break;