Maarten Lankhorst : quartz: Fix support for files with multiple odml indexes.

Alexandre Julliard julliard at winehq.org
Tue Jul 29 07:16:25 CDT 2008


Module: wine
Branch: master
Commit: 94ef37400ddd9f413b96549b2a37969cf9467a23
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=94ef37400ddd9f413b96549b2a37969cf9467a23

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Thu Jul 24 13:08:09 2008 -0700

quartz: Fix support for files with multiple odml indexes.

---

 dlls/quartz/avisplit.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c
index 4eebc39..3f1625c 100644
--- a/dlls/quartz/avisplit.c
+++ b/dlls/quartz/avisplit.c
@@ -183,7 +183,7 @@ static HRESULT AVISplitter_next_request(AVISplitterImpl *This, DWORD streamnumbe
             /* End of file */
             if (stream->index >= stream->entries)
             {
-                ERR("END OF STREAM ON %u\n", streamnumber);
+                TRACE("END OF STREAM ON %u\n", streamnumber);
                 IMediaSample_Release(sample);
                 return S_FALSE;
             }
@@ -213,8 +213,8 @@ static HRESULT AVISplitter_next_request(AVISplitterImpl *This, DWORD streamnumbe
             /* End of file */
             if (stream->index)
             {
+                TRACE("END OF STREAM ON %u\n", streamnumber);
                 IMediaSample_Release(sample);
-                ERR("END OF STREAM ON %u\n", streamnumber);
                 return S_FALSE;
             }
 
@@ -502,6 +502,7 @@ static HRESULT AVISplitter_done_process(LPVOID iface)
 
         ResetEvent(stream->packet_queued);
     }
+    FIXME("All threads are now terminated\n");
 
     return S_OK;
 }
@@ -516,8 +517,7 @@ static HRESULT AVISplitter_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
 static HRESULT AVISplitter_ProcessIndex(AVISplitterImpl *This, AVISTDINDEX **index, LONGLONG qwOffset, DWORD cb)
 {
     AVISTDINDEX *pIndex;
-    int x;
-    long rest;
+    int x, rest;
 
     *index = NULL;
     if (cb < sizeof(AVISTDINDEX))
@@ -531,12 +531,7 @@ static HRESULT AVISplitter_ProcessIndex(AVISplitterImpl *This, AVISTDINDEX **ind
         return E_OUTOFMEMORY;
 
     IAsyncReader_SyncRead(((PullPin *)This->Parser.ppPins[0])->pReader, qwOffset, cb, (BYTE *)pIndex);
-    pIndex = CoTaskMemRealloc(pIndex, pIndex->cb);
-    if (!pIndex)
-        return E_OUTOFMEMORY;
-
-    IAsyncReader_SyncRead(((PullPin *)This->Parser.ppPins[0])->pReader, qwOffset, pIndex->cb, (BYTE *)pIndex);
-    rest = pIndex->cb - sizeof(AVISUPERINDEX) + sizeof(RIFFCHUNK) + sizeof(pIndex->aIndex[0]) * ANYSIZE_ARRAY;
+    rest = cb - sizeof(AVISUPERINDEX) + sizeof(RIFFCHUNK) + sizeof(pIndex->aIndex);
 
     TRACE("FOURCC: %s\n", debugstr_an((char *)&pIndex->fcc, 4));
     TRACE("wLongsPerEntry: %hd\n", pIndex->wLongsPerEntry);
@@ -552,7 +547,11 @@ static HRESULT AVISplitter_ProcessIndex(AVISplitterImpl *This, AVISTDINDEX **ind
         || rest < (pIndex->nEntriesInUse * sizeof(DWORD) * pIndex->wLongsPerEntry)
         || (pIndex->bIndexSubType != AVI_INDEX_SUB_DEFAULT))
     {
-        FIXME("Invalid index chunk encountered\n");
+        FIXME("Invalid index chunk encountered: %u/%u, %u/%u, %u/%u, %u/%u\n",
+              pIndex->bIndexType, AVI_INDEX_OF_CHUNKS, pIndex->wLongsPerEntry, 2,
+              rest, (pIndex->nEntriesInUse * sizeof(DWORD) * pIndex->wLongsPerEntry),
+              pIndex->bIndexSubType, AVI_INDEX_SUB_DEFAULT);
+        *index = NULL;
         return E_INVALIDARG;
     }
 
@@ -814,7 +813,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE
                 TRACE("dwSize: %u\n", pIndex->aIndex[x].dwSize);
                 TRACE("dwDuration: %u (unreliable)\n", pIndex->aIndex[x].dwDuration);
 
-                AVISplitter_ProcessIndex(This, &stream->stdindex[nstdindex-1], pIndex->aIndex[x].qwOffset, pIndex->aIndex[x].dwSize);
+                AVISplitter_ProcessIndex(This, &stream->stdindex[x], pIndex->aIndex[x].qwOffset, pIndex->aIndex[x].dwSize);
             }
             break;
         }




More information about the wine-cvs mailing list