Commit 7905cc97 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wineqtdecoder: Do not fail state change methods if source pins are not connected.

parent ef7dcc7d
......@@ -278,25 +278,21 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
static HRESULT qt_splitter_start_stream(struct strmbase_filter *iface, REFERENCE_TIME time)
{
QTSplitter *filter = impl_from_strmbase_filter(iface);
HRESULT hr = VFW_E_NOT_CONNECTED, pin_hr;
HRESULT hr;
EnterCriticalSection(&filter->csReceive);
if (filter->pVideo_Pin)
{
if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->pVideo_Pin->pin)))
hr = pin_hr;
}
if (filter->pAudio_Pin)
{
if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->pAudio_Pin->pin)))
hr = pin_hr;
}
if (filter->pVideo_Pin && filter->pVideo_Pin->pin.pin.peer
&& FAILED(hr = IMemAllocator_Commit(filter->pVideo_Pin->pin.pAllocator)))
ERR("Failed to commit video allocator, hr %#x.\n", hr);
if (filter->pAudio_Pin && filter->pAudio_Pin->pin.pin.peer
&& FAILED(hr = IMemAllocator_Commit(filter->pAudio_Pin->pin.pAllocator)))
ERR("Failed to commit audio allocator, hr %#x.\n", hr);
SetEvent(filter->runEvent);
LeaveCriticalSection(&filter->csReceive);
return hr;
return S_OK;
}
static HRESULT qt_splitter_cleanup_stream(struct strmbase_filter *iface)
......
......@@ -561,16 +561,18 @@ static void video_decoder_destroy(struct strmbase_filter *iface)
static HRESULT video_decoder_init_stream(struct strmbase_filter *iface)
{
QTVDecoderImpl *This = impl_from_strmbase_filter(iface);
QTVDecoderImpl *filter = impl_from_strmbase_filter(iface);
HRESULT hr;
OSErr err = noErr;
ICMDecompressionSessionOptionsRef sessionOptions = NULL;
ICMDecompressionTrackingCallbackRecord trackingCallbackRecord;
trackingCallbackRecord.decompressionTrackingCallback = trackingCallback;
trackingCallbackRecord.decompressionTrackingRefCon = (void*)This;
trackingCallbackRecord.decompressionTrackingRefCon = filter;
err = ICMDecompressionSessionCreate(NULL, This->hImageDescription, sessionOptions, This->outputBufferAttributes, &trackingCallbackRecord, &This->decompressionSession);
err = ICMDecompressionSessionCreate(NULL, filter->hImageDescription, sessionOptions,
filter->outputBufferAttributes, &trackingCallbackRecord, &filter->decompressionSession);
if (err != noErr)
{
......@@ -578,18 +580,24 @@ static HRESULT video_decoder_init_stream(struct strmbase_filter *iface)
return E_FAIL;
}
return BaseOutputPinImpl_Active(&This->source);
if (filter->source.pin.peer && FAILED(hr = IMemAllocator_Commit(filter->source.pAllocator)))
ERR("Failed to commit allocator, hr %#x.\n", hr);
return S_OK;
}
static HRESULT video_decoder_cleanup_stream(struct strmbase_filter *iface)
{
QTVDecoderImpl* This = impl_from_strmbase_filter(iface);
QTVDecoderImpl *filter = impl_from_strmbase_filter(iface);
if (filter->decompressionSession)
ICMDecompressionSessionRelease(filter->decompressionSession);
filter->decompressionSession = NULL;
if (This->decompressionSession)
ICMDecompressionSessionRelease(This->decompressionSession);
This->decompressionSession = NULL;
if (filter->source.pin.peer)
IMemAllocator_Decommit(filter->source.pAllocator);
return BaseOutputPinImpl_Inactive(&This->source);
return S_OK;
}
static const struct strmbase_filter_ops filter_ops =
......
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