Author: akhaldi
Date: Sat Jun 3 22:28:56 2017
New Revision: 74813
URL:
http://svn.reactos.org/svn/reactos?rev=74813&view=rev
Log:
[MCIAVI32] Sync with Wine Staging 2.9. CORE-13362
c59dcfa mciavi32: Implement MCI_BREAK.
d3c25df mciavi32: Trace MCIAVI_CreateWindow.
1b57f07 mciavi32: Report version as 1.1.
Modified:
trunk/reactos/dll/win32/mciavi32/info.c
trunk/reactos/dll/win32/mciavi32/mciavi.c
trunk/reactos/dll/win32/mciavi32/private_mciavi.h
trunk/reactos/dll/win32/mciavi32/wnd.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/mciavi32/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciavi32/info.c?…
==============================================================================
--- trunk/reactos/dll/win32/mciavi32/info.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciavi32/info.c [iso-8859-1] Sat Jun 3 22:28:56 2017
@@ -187,6 +187,7 @@
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0;
static const WCHAR wszAviPlayer[] =
{'W','i','n','e','\'','s','
','A','V','I','
','p','l','a','y','e','r',0};
+ static const WCHAR wszVersion[] = {'1','.','1',0};
if (lpParms == NULL || lpParms->lpstrReturn == NULL)
return MCIERR_NULL_PARAMETER_BLOCK;
@@ -199,6 +200,8 @@
if (dwFlags & MCI_INFO_PRODUCT)
str = wszAviPlayer;
+ else if (dwFlags & MCI_INFO_VERSION)
+ str = wszVersion;
else if (dwFlags & MCI_INFO_FILE)
str = wma->lpFileName;
else {
Modified: trunk/reactos/dll/win32/mciavi32/mciavi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciavi32/mciavi.…
==============================================================================
--- trunk/reactos/dll/win32/mciavi32/mciavi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciavi32/mciavi.c [iso-8859-1] Sat Jun 3 22:28:56 2017
@@ -351,6 +351,7 @@
DWORD numEvents = 1;
HANDLE events[2];
double next_frame_us;
+ BOOL wait_audio = TRUE;
EnterCriticalSection(&wma->cs);
@@ -417,19 +418,37 @@
else
delta = 0;
+ /* check if the playback was cancelled */
+ if ((wma->mci_break.flags & MCI_BREAK_KEY) &&
+ (GetAsyncKeyState(wma->mci_break.parms.nVirtKey) & 0x8000))
+ {
+ if (!(wma->mci_break.flags & MCI_BREAK_HWND) ||
+ GetForegroundWindow() == wma->mci_break.parms.hwndBreak)
+ {
+ /* we queue audio blocks ahead so ignore them otherwise the audio
+ * will keep playing until the buffer is empty */
+ wait_audio = FALSE;
+
+ TRACE("playback cancelled using break key\n");
+ break;
+ }
+ }
+
LeaveCriticalSection(&wma->cs);
ret = WaitForMultipleObjects(numEvents, events, FALSE, delta / 1000);
EnterCriticalSection(&wma->cs);
if (ret == WAIT_OBJECT_0 || wma->dwStatus != MCI_MODE_PLAY) break;
}
- if (wma->lpWaveFormat) {
- while (wma->dwEventCount != nHdr - 1)
- {
- LeaveCriticalSection(&wma->cs);
- Sleep(100);
- EnterCriticalSection(&wma->cs);
- }
+ if (wma->lpWaveFormat)
+ {
+ if (wait_audio)
+ while (wma->dwEventCount != nHdr - 1)
+ {
+ LeaveCriticalSection(&wma->cs);
+ Sleep(100);
+ EnterCriticalSection(&wma->cs);
+ }
/* just to get rid of some race conditions between play, stop and pause */
LeaveCriticalSection(&wma->cs);
@@ -869,6 +888,30 @@
}
/******************************************************************************
+ * MCIAVI_mciBreak [internal]
+ */
+static DWORD MCIAVI_mciBreak(UINT wDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms)
+{
+ WINE_MCIAVI *wma;
+
+ TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);
+
+ if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
+
+ wma = MCIAVI_mciGetOpenDev(wDevID);
+ if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
+
+ EnterCriticalSection(&wma->cs);
+
+ wma->mci_break.flags = dwFlags;
+ wma->mci_break.parms = *lpParms;
+
+ LeaveCriticalSection(&wma->cs);
+
+ return 0;
+}
+
+/******************************************************************************
* MCIAVI_mciSetAudio [internal]
*/
static DWORD MCIAVI_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_PARMSW
lpParms)
@@ -986,6 +1029,7 @@
case MCI_WHERE: return MCIAVI_mciWhere (dwDevID, dwParam1, (LPMCI_DGV_RECT_PARMS)
dwParam2);
case MCI_STEP: return MCIAVI_mciStep (dwDevID, dwParam1, (LPMCI_DGV_STEP_PARMS)
dwParam2);
case MCI_CUE: return MCIAVI_mciCue (dwDevID, dwParam1, (LPMCI_DGV_CUE_PARMS)
dwParam2);
+ case MCI_BREAK: return MCIAVI_mciBreak (dwDevID, dwParam1, (LPMCI_BREAK_PARMS)
dwParam2);
/* Digital Video specific */
case MCI_SETAUDIO: return MCIAVI_mciSetAudio (dwDevID, dwParam1,
(LPMCI_DGV_SETAUDIO_PARMSW) dwParam2);
case MCI_SIGNAL: return MCIAVI_mciSignal (dwDevID, dwParam1,
(LPMCI_DGV_SIGNAL_PARMS) dwParam2);
Modified: trunk/reactos/dll/win32/mciavi32/private_mciavi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciavi32/private…
==============================================================================
--- trunk/reactos/dll/win32/mciavi32/private_mciavi.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciavi32/private_mciavi.h [iso-8859-1] Sat Jun 3 22:28:56
2017
@@ -81,6 +81,11 @@
DWORD dwToVideoFrame; /* play to */
DWORD dwCurrAudioBlock; /* current audio block being played */
RECT source, dest;
+ struct
+ {
+ DWORD flags;
+ MCI_BREAK_PARMS parms;
+ } mci_break;
/* data for the background mechanism */
CRITICAL_SECTION cs;
HANDLE hStopEvent;
Modified: trunk/reactos/dll/win32/mciavi32/wnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciavi32/wnd.c?r…
==============================================================================
--- trunk/reactos/dll/win32/mciavi32/wnd.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciavi32/wnd.c [iso-8859-1] Sat Jun 3 22:28:56 2017
@@ -105,7 +105,7 @@
return FALSE;
}
-BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW
lpOpenParms)
+BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW
lpParms)
{
static const WCHAR captionW[] =
{'W','i','n','e','
','M','C','I','-','A','V','I','
','p','l','a','y','e','r',0};
HWND hParent = 0;
@@ -115,8 +115,8 @@
/* what should be done ? */
if (wma->hWnd) return TRUE;
- if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent;
- if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle;
+ if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpParms->hWndParent;
+ if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpParms->dwStyle;
if (wma->hic)
SetRect(&rc, 0, 0, wma->outbih->biWidth, wma->outbih->biHeight);
@@ -137,6 +137,9 @@
hParent, 0, MCIAVI_hInstance,
ULongToPtr(wma->wDevID));
wma->hWndPaint = wma->hWnd;
+
+ TRACE("(%04x, %08X, %p, style %x, parent %p, dimensions %dx%d, hwnd %p)\n",
wma->wDevID,
+ dwFlags, lpParms, dwStyle, hParent, rc.right - rc.left, rc.bottom - rc.top,
wma->hWnd);
return wma->hWnd != 0;
}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:28:56 2017
@@ -90,7 +90,7 @@
reactos/dll/win32/loadperf # Synced to WineStaging-2.2
reactos/dll/win32/lz32 # Synced to WineStaging-1.9.11
reactos/dll/win32/mapi32 # Synced to WineStaging-2.2
-reactos/dll/win32/mciavi32 # Synced to WineStaging-1.9.16
+reactos/dll/win32/mciavi32 # Synced to WineStaging-2.9
reactos/dll/win32/mcicda # Synced to WineStaging-1.9.16
reactos/dll/win32/mciqtz32 # Synced to WineStaging-2.2
reactos/dll/win32/mciseq # Synced to WineStaging-1.9.11