Commit 20d87e76 authored by Chris Robinson's avatar Chris Robinson Committed by Alexandre Julliard

quartz: Make sure cached media samples are released for parser filters.

parent 828d5a0c
......@@ -577,6 +577,19 @@ static HRESULT AVISplitter_InputPin_PreConnect(IPin * iface, IPin * pConnectPin)
return hr;
}
static HRESULT AVISplitter_Cleanup(LPVOID iface)
{
AVISplitterImpl *This = (AVISplitterImpl*)iface;
TRACE("(%p)->()\n", This);
if (This->pCurrentSample)
IMediaSample_Release(This->pCurrentSample);
This->pCurrentSample = NULL;
return S_OK;
}
HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
HRESULT hr;
......@@ -594,7 +607,7 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
This->pCurrentSample = NULL;
hr = Parser_Create(&(This->Parser), &CLSID_AviSplitter, AVISplitter_Sample, AVISplitter_QueryAccept, AVISplitter_InputPin_PreConnect, NULL);
hr = Parser_Create(&(This->Parser), &CLSID_AviSplitter, AVISplitter_Sample, AVISplitter_QueryAccept, AVISplitter_InputPin_PreConnect, AVISplitter_Cleanup);
if (FAILED(hr))
return hr;
......
......@@ -301,6 +301,19 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin)
return hr;
}
static HRESULT WAVEParser_Cleanup(LPVOID iface)
{
WAVEParserImpl *This = (WAVEParserImpl*)iface;
TRACE("(%p)->()\n", This);
if (This->pCurrentSample)
IMediaSample_Release(This->pCurrentSample);
This->pCurrentSample = NULL;
return S_OK;
}
HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
HRESULT hr;
......@@ -318,7 +331,7 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
This->pCurrentSample = NULL;
hr = Parser_Create(&(This->Parser), &CLSID_WAVEParser, WAVEParser_Sample, WAVEParser_QueryAccept, WAVEParser_InputPin_PreConnect, NULL);
hr = Parser_Create(&(This->Parser), &CLSID_WAVEParser, WAVEParser_Sample, WAVEParser_QueryAccept, WAVEParser_InputPin_PreConnect, WAVEParser_Cleanup);
if (FAILED(hr))
return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment