Changelog: - Implemented AVIStreamBeginStreaming and AVIStreamEndStreaming. - Fixed loading of empty AVI files. - Fixed bug in IGetFrame interface with uncompressed streams. - Fixed missing ICOM_DEFINE for IAVIStreaming. Michael
Index: dlls/avifil32/api.c =================================================================== RCS file: /home/wine/wine/dlls/avifil32/api.c,v retrieving revision 1.21 diff -d -u -r1.21 api.c --- dlls/avifil32/api.c 8 Aug 2003 21:07:23 -0000 1.21 +++ dlls/avifil32/api.c 31 Aug 2003 09:44:28 -0000 @@ -840,9 +840,22 @@ */ LONG WINAPI AVIStreamBeginStreaming(PAVISTREAM pavi, LONG lStart, LONG lEnd, LONG lRate) { - FIXME("(%p)->(%ld,%ld,%ld)\n", pavi, lStart, lEnd, lRate); + IAVIStreaming* pstream = NULL; + HRESULT hr; - return AVIERR_OK; + TRACE("(%p,%ld,%ld,%ld)\n", pavi, lStart, lEnd, lRate); + + if (pavi == NULL) + return AVIERR_BADHANDLE; + + hr = IAVIStream_QueryInterface(pavi, &IID_IAVIStreaming, (LPVOID*)&pstream); + if (SUCCEEDED(hr) && pstream != NULL) { + hr = IAVIStreaming_Begin(pstream, lStart, lEnd, lRate); + IAVIStreaming_Release(pstream); + } else + hr = AVIERR_OK; + + return hr; } /*********************************************************************** @@ -850,9 +863,18 @@ */ LONG WINAPI AVIStreamEndStreaming(PAVISTREAM pavi) { - FIXME("(%p)\n", pavi); + IAVIStreaming* pstream = NULL; + HRESULT hr; - return AVIERR_OK; + TRACE("(%p)\n", pavi); + + hr = IAVIStream_QueryInterface(pavi, &IID_IAVIStreaming, (LPVOID*)&pstream); + if (SUCCEEDED(hr) && pstream != NULL) { + IAVIStreaming_End(pstream); + IAVIStreaming_Release(pstream); + } + + return AVIERR_OK; } /*********************************************************************** Index: dlls/avifil32/avifile.c =================================================================== RCS file: /home/wine/wine/dlls/avifil32/avifile.c,v retrieving revision 1.36 diff -d -u -r1.36 avifile.c --- dlls/avifil32/avifile.c 21 Jul 2003 19:59:57 -0000 1.36 +++ dlls/avifil32/avifile.c 31 Aug 2003 09:44:39 -0000 @@ -1678,6 +1678,9 @@ case ckidSTREAMFORMAT: if (pStream->lpFormat != NULL) return AVIERR_BADFORMAT; + if (ck.cksize == 0) + break; + pStream->lpFormat = GlobalAllocPtr(GMEM_DDESHARE|GMEM_MOVEABLE, ck.cksize); if (pStream->lpFormat == NULL) @@ -2387,9 +2390,6 @@ /* not interleaved -- write index for each stream at once */ for (nStream = 0; nStream < This->fInfo.dwStreams; nStream++) { pStream = This->ppStreams[nStream]; - - if (pStream->lLastFrame == -1) - pStream->lLastFrame = 0; for (n = 0; n <= pStream->lLastFrame; n++) { if ((pStream->sInfo.dwFlags & AVISTREAMINFO_FORMATCHANGES) && Index: dlls/avifil32/getframe.c =================================================================== RCS file: /home/wine/wine/dlls/avifil32/getframe.c,v retrieving revision 1.6 diff -d -u -r1.6 getframe.c --- dlls/avifil32/getframe.c 23 Jun 2003 18:10:06 -0000 1.6 +++ dlls/avifil32/getframe.c 31 Aug 2003 09:44:41 -0000 @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002-2003 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -227,9 +227,9 @@ if (lNext == -1) return NULL; if (lNext <= This->lCurrentFrame && This->lCurrentFrame < lPos) - lNext++; + lNext = This->lCurrentFrame + 1; - for (; lNext < lPos; lNext++) { + for (; lNext <= lPos; lNext++) { /* new format for this frame? */ if (This->bFormatChanges) { AVIStreamReadFormat(This->pStream, lNext, This->lpInFormat, &This->cbInFormat); Index: include/vfw.h =================================================================== RCS file: /home/wine/wine/include/vfw.h,v retrieving revision 1.37 diff -d -u -r1.37 vfw.h --- include/vfw.h 28 Aug 2003 21:43:35 -0000 1.37 +++ include/vfw.h 31 Aug 2003 09:45:08 -0000 @@ -1118,6 +1118,7 @@ IUnknown_METHODS \ STDMETHOD(Begin)(IAVIStreaming*iface,LONG lStart,LONG lEnd,LONG lRate) PURE; \ STDMETHOD(End)(IAVIStreaming*iface) PURE; +ICOM_DEFINE(IAVIStreaming, IUnknown) #undef INTERFACE #ifdef COBJMACROS