- Implemented AVIStreamBeginStreaming and AVIStreamEndStreaming.

- Fixed loading of empty AVI files.
- Fixed bug in IGetFrame interface with uncompressed streams.
- Fixed missing ICOM_DEFINE for IAVIStreaming.
oldstable
Michael Günnewig 2003-09-02 00:54:30 +00:00 committed by Alexandre Julliard
parent c435c29339
commit 1b5c4135e2
4 changed files with 33 additions and 10 deletions

View File

@ -840,9 +840,22 @@ HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile,
*/
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 AVIStreamBeginStreaming(PAVISTREAM pavi, LONG lStart, LONG lEnd, LON
*/
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;
}
/***********************************************************************

View File

@ -1678,6 +1678,9 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
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)
@ -2388,9 +2391,6 @@ static HRESULT AVIFILE_SaveIndex(IAVIFileImpl *This)
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) &&
(pStream->sInfo.dwFormatChangeCount != 0)) {

View File

@ -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 @@ static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos)
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);

View File

@ -1118,6 +1118,7 @@ LONG WINAPI AVIStreamTimeToSample(PAVISTREAM pstream, LONG lTime);
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