Henri Verbeet : avifil32: Always add the format change frame to the buffer in AVIFILE_AddFrame().

Alexandre Julliard julliard at winehq.org
Wed Jan 6 13:00:55 CST 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jan  5 21:28:59 2010 +0100

avifil32: Always add the format change frame to the buffer in AVIFILE_AddFrame().

It doesn't make sense to only do this when the buffer is resized.

---

 dlls/avifil32/avifile.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index c4f191a..57f8294 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -1362,6 +1362,8 @@ static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream *iface,
 
 static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DWORD offset, DWORD flags)
 {
+  UINT n;
+
   /* pre-conditions */
   assert(This != NULL);
 
@@ -1383,8 +1385,6 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
     This->sInfo.dwFormatChangeCount++;
 
     if (This->idxFmtChanges == NULL || This->sInfo.dwFormatChangeCount < This->nIdxFmtChanges) {
-      UINT n = This->sInfo.dwFormatChangeCount;
-
       This->nIdxFmtChanges += 16;
       if (This->idxFmtChanges == NULL)
 	This->idxFmtChanges =
@@ -1395,15 +1395,15 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
 			   This->nIdxFmtChanges * sizeof(AVIINDEXENTRY));
       if (This->idxFmtChanges == NULL)
 	return AVIERR_MEMORY;
+    }
 
-      This->idxFmtChanges[n].ckid          = This->lLastFrame;
-      This->idxFmtChanges[n].dwFlags       = 0;
-      This->idxFmtChanges[n].dwChunkOffset = offset;
-      This->idxFmtChanges[n].dwChunkLength = size;
+    n = This->sInfo.dwFormatChangeCount;
+    This->idxFmtChanges[n].ckid          = This->lLastFrame;
+    This->idxFmtChanges[n].dwFlags       = 0;
+    This->idxFmtChanges[n].dwChunkOffset = offset;
+    This->idxFmtChanges[n].dwChunkLength = size;
 
-      return AVIERR_OK;
-    }
-    break;
+    return AVIERR_OK;
   case cktypeWAVEbytes:
     if (This->paf->fInfo.dwFlags & AVIFILEINFO_TRUSTCKTYPE)
       flags |= AVIIF_KEYFRAME;




More information about the wine-cvs mailing list