Author: akhaldi
Date: Sat Sep 16 20:45:04 2017
New Revision: 75858

URL: http://svn.reactos.org/svn/reactos?rev=75858&view=rev
Log:
[QUARTZ] Sync with Wine Staging 2.16. CORE-13762

84f5761 quartz: Use standard wine_dbgstr_longlong.
e994c62 quartz: Use nAvgBytesPerSec to calculate length.
e1d14d2 quartz: Restore a comment explaining mediatime.
bf9eaac quartz: Small readability fix.

Modified:
    trunk/reactos/dll/directx/wine/quartz/avisplit.c
    trunk/reactos/dll/directx/wine/quartz/dsoundrender.c
    trunk/reactos/dll/directx/wine/quartz/filesource.c
    trunk/reactos/dll/directx/wine/quartz/quartz_private.h
    trunk/reactos/dll/directx/wine/quartz/vmr9.c
    trunk/reactos/dll/directx/wine/quartz/waveparser.c

Modified: trunk/reactos/dll/directx/wine/quartz/avisplit.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/avisplit.c?rev=75858&r1=75857&r2=75858&view=diff
==============================================================================
--- trunk/reactos/dll/directx/wine/quartz/avisplit.c    [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/quartz/avisplit.c    [iso-8859-1] Sat Sep 16 
20:45:04 2017
@@ -558,7 +558,7 @@
     TRACE("bIndexType: %u\n", pIndex->bIndexType);
     TRACE("nEntriesInUse: %u\n", pIndex->nEntriesInUse);
     TRACE("dwChunkId: %.4s\n", (char *)&pIndex->dwChunkId);
-    TRACE("qwBaseOffset: %x%08x\n", (DWORD)(pIndex->qwBaseOffset >> 32), 
(DWORD)pIndex->qwBaseOffset);
+    TRACE("qwBaseOffset: %s\n", wine_dbgstr_longlong(pIndex->qwBaseOffset));
     TRACE("dwReserved_3: %u\n", pIndex->dwReserved_3);
 
     if (pIndex->bIndexType != AVI_INDEX_OF_CHUNKS
@@ -578,7 +578,7 @@
     {
         BOOL keyframe = !(pIndex->aIndex[x].dwSize >> 31);
         DWORDLONG offset = pIndex->qwBaseOffset + pIndex->aIndex[x].dwOffset;
-        TRACE("dwOffset: %x%08x\n", (DWORD)(offset >> 32), (DWORD)offset);
+        TRACE("dwOffset: %s\n", wine_dbgstr_longlong(offset));
         TRACE("dwSize: %u\n", (pIndex->aIndex[x].dwSize & ~(1u << 31)));
         TRACE("Frame is a keyframe: %s\n", keyframe ? "yes" : "no");
     }
@@ -629,9 +629,9 @@
                 }
                 else if (temp2 != chunkid)
                 {
-                    ERR("Faulty index or bug in handling: Wanted FCC: %s, Abs 
FCC: %s (@ %x), Rel FCC: %s (@ %.0x%08x)\n",
+                    ERR("Faulty index or bug in handling: Wanted FCC: %s, Abs 
FCC: %s (@ %x), Rel FCC: %s (@ %s)\n",
                         debugstr_an((char *)&chunkid, 4), debugstr_an((char 
*)&temp, 4), offset,
-                        debugstr_an((char *)&temp2, 4), (DWORD)((mov_pos + 
offset) >> 32), (DWORD)(mov_pos + offset));
+                        debugstr_an((char *)&temp2, 4), 
wine_dbgstr_longlong(mov_pos + offset));
                     relative = -1;
                 }
                 else
@@ -828,7 +828,7 @@
             stream->stdindex = CoTaskMemRealloc(stream->stdindex, 
sizeof(*stream->stdindex) * stream->entries);
             for (x = 0; x < pIndex->nEntriesInUse; ++x)
             {
-                TRACE("qwOffset: %x%08x\n", (DWORD)(pIndex->aIndex[x].qwOffset 
>> 32), (DWORD)pIndex->aIndex[x].qwOffset);
+                TRACE("qwOffset: %s\n", 
wine_dbgstr_longlong(pIndex->aIndex[x].qwOffset));
                 TRACE("dwSize: %u\n", pIndex->aIndex[x].dwSize);
                 TRACE("dwDuration: %u (unreliable)\n", 
pIndex->aIndex[x].dwDuration);
 
@@ -1117,7 +1117,7 @@
     pAviSplit->EndOfFile = This->rtStop = MEDIATIME_FROM_BYTES(pos);
     if (pos > total)
     {
-        ERR("File smaller (%x%08x) then EndOfFile (%x%08x)\n", (DWORD)(total 
>> 32), (DWORD)total, (DWORD)(pAviSplit->EndOfFile >> 32), 
(DWORD)pAviSplit->EndOfFile);
+        ERR("File smaller (%s) then EndOfFile (%s)\n", 
wine_dbgstr_longlong(total), wine_dbgstr_longlong(pAviSplit->EndOfFile));
         return E_FAIL;
     }
 

Modified: trunk/reactos/dll/directx/wine/quartz/dsoundrender.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/dsoundrender.c?rev=75858&r1=75857&r2=75858&view=diff
==============================================================================
--- trunk/reactos/dll/directx/wine/quartz/dsoundrender.c        [iso-8859-1] 
(original)
+++ trunk/reactos/dll/directx/wine/quartz/dsoundrender.c        [iso-8859-1] 
Sat Sep 16 20:45:04 2017
@@ -97,9 +97,9 @@
 static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time) {
     WAVEFORMATEX *wfx = 
(WAVEFORMATEX*)This->renderer.pInputPin->pin.mtCurrent.pbFormat;
     REFERENCE_TIME ret = time;
-    ret *= wfx->nSamplesPerSec;
+    ret *= wfx->nAvgBytesPerSec;
     ret /= 10000000;
-    ret *= wfx->nBlockAlign;
+    ret -= ret % wfx->nBlockAlign;
     return ret;
 }
 
@@ -406,7 +406,7 @@
     TRACE("Format = %p\n", format);
     TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM);
     TRACE("nChannels = %d\n", format->nChannels);
-    TRACE("nSamplesPerSec = %d\n", format->nAvgBytesPerSec);
+    TRACE("nSamplesPerSec = %d\n", format->nSamplesPerSec);
     TRACE("nAvgBytesPerSec = %d\n", format->nAvgBytesPerSec);
     TRACE("nBlockAlign = %d\n", format->nBlockAlign);
     TRACE("wBitsPerSample = %d\n", format->wBitsPerSample);

Modified: trunk/reactos/dll/directx/wine/quartz/filesource.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/filesource.c?rev=75858&r1=75857&r2=75858&view=diff
==============================================================================
--- trunk/reactos/dll/directx/wine/quartz/filesource.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/quartz/filesource.c  [iso-8859-1] Sat Sep 16 
20:45:04 2017
@@ -1320,7 +1320,7 @@
     HRESULT hr = S_OK;
     FileAsyncReader *This = impl_from_IAsyncReader(iface);
 
-    TRACE("(%x%08x, %d, %p)\n", (ULONG)(llPosition >> 32), (ULONG)llPosition, 
lLength, pBuffer);
+    TRACE("(%s, %d, %p)\n", wine_dbgstr_longlong(llPosition), lLength, 
pBuffer);
 
     ZeroMemory(&ovl, sizeof(ovl));
 

Modified: trunk/reactos/dll/directx/wine/quartz/quartz_private.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/quartz_private.h?rev=75858&r1=75857&r2=75858&view=diff
==============================================================================
--- trunk/reactos/dll/directx/wine/quartz/quartz_private.h      [iso-8859-1] 
(original)
+++ trunk/reactos/dll/directx/wine/quartz/quartz_private.h      [iso-8859-1] 
Sat Sep 16 20:45:04 2017
@@ -52,6 +52,7 @@
 #include "pin.h"
 #include "parser.h"
 
+/* see IAsyncReader::Request on MSDN for the explanation of this */
 #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000)
 #define SEC_FROM_MEDIATIME(time) ((time) / 10000000)
 #define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time)

Modified: trunk/reactos/dll/directx/wine/quartz/vmr9.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/vmr9.c?rev=75858&r1=75857&r2=75858&view=diff
==============================================================================
--- trunk/reactos/dll/directx/wine/quartz/vmr9.c        [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/quartz/vmr9.c        [iso-8859-1] Sat Sep 16 
20:45:04 2017
@@ -365,7 +365,7 @@
         ERR("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
         return S_FALSE;
     }
-    if (This->bmiheader.biCompression)
+    if (This->bmiheader.biCompression != BI_RGB)
         return S_FALSE;
     return S_OK;
 }

Modified: trunk/reactos/dll/directx/wine/quartz/waveparser.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/waveparser.c?rev=75858&r1=75857&r2=75858&view=diff
==============================================================================
--- trunk/reactos/dll/directx/wine/quartz/waveparser.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/quartz/waveparser.c  [iso-8859-1] Sat Sep 16 
20:45:04 2017
@@ -27,9 +27,8 @@
     ParserImpl Parser;
     LONGLONG StartOfFile; /* in media time */
     LONGLONG EndOfFile;
-    DWORD dwSampleSize;
-    DWORD nSamplesPerSec;
-    DWORD dwLength;
+    DWORD nAvgBytesPerSec;
+    DWORD nBlockAlign;
 } WAVEParserImpl;
 
 static inline WAVEParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
@@ -46,7 +45,7 @@
 {
     LONGLONG duration = BYTES_FROM_MEDIATIME(bytepos - This->StartOfFile);
     duration *= 10000000;
-    duration /= (This->dwSampleSize * This->nSamplesPerSec);
+    duration /= This->nAvgBytesPerSec;
 
     return duration;
 }
@@ -55,11 +54,11 @@
 {
     LONGLONG bytepos;
 
-    bytepos = (This->dwSampleSize * This->nSamplesPerSec);
+    bytepos = This->nAvgBytesPerSec;
     bytepos *= duration;
     bytepos /= 10000000;
+    bytepos -= bytepos % This->nBlockAlign;
     bytepos += BYTES_FROM_MEDIATIME(This->StartOfFile);
-    bytepos -= bytepos % This->dwSampleSize;
 
     return MEDIATIME_FROM_BYTES(bytepos);
 }
@@ -236,7 +235,6 @@
     PIN_INFO piOutput;
     AM_MEDIA_TYPE amt;
     WAVEParserImpl * pWAVEParser = 
impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
-    LONGLONG length, avail;
 
     piOutput.dir = PINDIR_OUTPUT;
     piOutput.pFilter = &pWAVEParser->Parser.filter.IBaseFilter_iface;
@@ -305,10 +303,8 @@
     props->cbPrefix = 0;
     props->cbBuffer = 4096;
     props->cBuffers = 3;
-    pWAVEParser->dwSampleSize = ((WAVEFORMATEX*)amt.pbFormat)->nBlockAlign;
-    IAsyncReader_Length(This->pReader, &length, &avail);
-    pWAVEParser->dwLength = length / (ULONGLONG)pWAVEParser->dwSampleSize;
-    pWAVEParser->nSamplesPerSec = 
((WAVEFORMATEX*)amt.pbFormat)->nSamplesPerSec;
+    pWAVEParser->nBlockAlign = ((WAVEFORMATEX*)amt.pbFormat)->nBlockAlign;
+    pWAVEParser->nAvgBytesPerSec = 
((WAVEFORMATEX*)amt.pbFormat)->nAvgBytesPerSec;
     hr = Parser_AddPin(&(pWAVEParser->Parser), &piOutput, props, &amt);
     CoTaskMemFree(amt.pbFormat);
 


Reply via email to