Author: akhaldi
Date: Tue Nov 17 12:58:22 2015
New Revision: 69922
URL:
http://svn.reactos.org/svn/reactos?rev=69922&view=rev
Log:
[AVIFIL32] Sync with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/reactos/dll/win32/avifil32/api.c
trunk/reactos/dll/win32/avifil32/avifile.c
trunk/reactos/dll/win32/avifil32/icmstream.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/avifil32/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/avifil32/api.c?r…
==============================================================================
--- trunk/reactos/dll/win32/avifil32/api.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/avifil32/api.c [iso-8859-1] Tue Nov 17 12:58:22 2015
@@ -2256,17 +2256,85 @@
HRESULT WINAPIV AVISaveA(LPCSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK
lpfnCallback,
int nStreams, PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions,
...)
{
- FIXME("(%s,%p,%p,0x%08x,%p,%p), stub!\n", debugstr_a(szFile),
pclsidHandler, lpfnCallback,
+ va_list vl;
+ int i;
+ HRESULT ret;
+ PAVISTREAM *streams;
+ LPAVICOMPRESSOPTIONS *options;
+
+ TRACE("(%s,%p,%p,%d,%p,%p)\n", debugstr_a(szFile), pclsidHandler,
lpfnCallback,
nStreams, pavi, lpOptions);
- return AVIERR_UNSUPPORTED;
+ if (nStreams <= 0) return AVIERR_BADPARAM;
+
+ streams = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *));
+ options = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *));
+ if (!streams || !options)
+ {
+ ret = AVIERR_MEMORY;
+ goto error;
+ }
+
+ streams[0] = pavi;
+ options[0] = lpOptions;
+
+ va_start(vl, lpOptions);
+ for (i = 1; i < nStreams; i++)
+ {
+ streams[i] = va_arg(vl, void *);
+ options[i] = va_arg(vl, void *);
+ }
+ va_end(vl);
+
+ for (i = 0; i < nStreams; i++)
+ TRACE("Pair[%d] - Stream = %p, Options = %p\n", i, streams[i],
options[i]);
+
+ ret = AVISaveVA(szFile, pclsidHandler, lpfnCallback, nStreams, streams, options);
+error:
+ HeapFree(GetProcessHeap(), 0, streams);
+ HeapFree(GetProcessHeap(), 0, options);
+ return ret;
}
HRESULT WINAPIV AVISaveW(LPCWSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK
lpfnCallback,
int nStreams, PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions,
...)
{
- FIXME("(%s,%p,%p,0x%08x,%p,%p), stub!\n", debugstr_w(szFile),
pclsidHandler, lpfnCallback,
+ va_list vl;
+ int i;
+ HRESULT ret;
+ PAVISTREAM *streams;
+ LPAVICOMPRESSOPTIONS *options;
+
+ TRACE("(%s,%p,%p,%d,%p,%p)\n", debugstr_w(szFile), pclsidHandler,
lpfnCallback,
nStreams, pavi, lpOptions);
- return AVIERR_UNSUPPORTED;
-}
+ if (nStreams <= 0) return AVIERR_BADPARAM;
+
+ streams = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *));
+ options = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *));
+ if (!streams || !options)
+ {
+ ret = AVIERR_MEMORY;
+ goto error;
+ }
+
+ streams[0] = pavi;
+ options[0] = lpOptions;
+
+ va_start(vl, lpOptions);
+ for (i = 1; i < nStreams; i++)
+ {
+ streams[i] = va_arg(vl, void *);
+ options[i] = va_arg(vl, void *);
+ }
+ va_end(vl);
+
+ for (i = 0; i < nStreams; i++)
+ TRACE("Pair[%d] - Stream = %p, Options = %p\n", i, streams[i],
options[i]);
+
+ ret = AVISaveVW(szFile, pclsidHandler, lpfnCallback, nStreams, streams, options);
+error:
+ HeapFree(GetProcessHeap(), 0, streams);
+ HeapFree(GetProcessHeap(), 0, options);
+ return ret;
+}
Modified: trunk/reactos/dll/win32/avifil32/avifile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/avifil32/avifile…
==============================================================================
--- trunk/reactos/dll/win32/avifil32/avifile.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/avifil32/avifile.c [iso-8859-1] Tue Nov 17 12:58:22 2015
@@ -1968,13 +1968,17 @@
if (nStream > This->fInfo.dwStreams)
return AVIERR_BADFORMAT;
+ /* Video frames can be either indexed in a relative position to the
+ * "movi" chunk or in a absolute position in the file. If the index
+ * is relative the frame offset will always be so small that it will
+ * virtually never reach the "movi" offset so we can detect if the
+ * video is relative very fast.
+ */
if (*bAbsolute && lp->dwChunkOffset < This->dwMoviChunkPos)
*bAbsolute = FALSE;
- if (*bAbsolute)
- lp->dwChunkOffset += sizeof(DWORD);
- else
- lp->dwChunkOffset += pos;
+ if (!*bAbsolute)
+ lp->dwChunkOffset += pos; /* make the offset absolute */
if (FAILED(AVIFILE_AddFrame(This->ppStreams[nStream], lp->ckid,
lp->dwChunkLength, lp->dwChunkOffset, lp->dwFlags)))
return AVIERR_MEMORY;
Modified: trunk/reactos/dll/win32/avifil32/icmstream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/avifil32/icmstre…
==============================================================================
--- trunk/reactos/dll/win32/avifil32/icmstream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/avifil32/icmstream.c [iso-8859-1] Tue Nov 17 12:58:22 2015
@@ -756,11 +756,11 @@
if (This->lKeyFrameEvery != 0) {
if (This->lCurrent == This->sInfo.dwStart) {
if (idxFlags & AVIIF_KEYFRAME) {
- /* for keyframes allow to consume all unused bytes */
+ /* allow keyframes to consume all unused bytes */
dwRequest = This->dwBytesPerFrame + This->dwUnusedBytes;
This->dwUnusedBytes = 0;
} else {
- /* for non-keyframes only allow something of the unused bytes to be consumed */
+ /* for non-keyframes only allow some of the unused bytes to be consumed */
DWORD tmp1 = 0;
DWORD tmp2;
@@ -782,8 +782,8 @@
dwRequest = MAX_FRAMESIZE;
}
- /* must we check for framesize to gain requested
- * datarate or could we trust codec? */
+ /* must we check for frame size to gain the requested
+ * data rate or can we trust the codec? */
doSizeCheck = (dwRequest != 0 && ((This->dwICMFlags &
(VIDCF_CRUNCH|VIDCF_QUALITY)) == 0));
dwMaxQual = dwCurQual = This->sInfo.dwQuality;
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] Tue Nov 17 12:58:22 2015
@@ -48,7 +48,7 @@
reactos/dll/win32/atl # Synced to WineStaging-1.7.55
reactos/dll/win32/atl80 # Synced to WineStaging-1.7.55
reactos/dll/win32/atl100 # Synced to WineStaging-1.7.55
-reactos/dll/win32/avifil32 # Synced to WineStaging-1.7.47
+reactos/dll/win32/avifil32 # Synced to WineStaging-1.7.55
reactos/dll/win32/bcrypt # Synced to WineStaging-1.7.47
reactos/dll/win32/browseui # Out of sync
reactos/dll/win32/cabinet # Synced to WineStaging-1.7.47