Bruno Jesus : avifil32: Absolute addresses already point to the correct place in the frame.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Oct 19 11:34:20 CDT 2015
Module: wine
Branch: master
Commit: 175138a42c83f10df1d7529f9c46ef1f3dd25f5d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=175138a42c83f10df1d7529f9c46ef1f3dd25f5d
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Sun Oct 18 01:05:39 2015 +0800
avifil32: Absolute addresses already point to the correct place in the frame.
Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/avifil32/avifile.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index f5abc1c..f649d05 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -1987,13 +1987,17 @@ static HRESULT AVIFILE_ParseIndex(const IAVIFileImpl *This, AVIINDEXENTRY *lp,
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;
More information about the wine-cvs
mailing list