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

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-11-17 11:37:53 -06:00 committed by Alexandre Julliard
parent ef7dcc7d51
commit 7905cc975f
2 changed files with 25 additions and 21 deletions

View file

@ -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)

View file

@ -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 (This->decompressionSession)
ICMDecompressionSessionRelease(This->decompressionSession);
This->decompressionSession = NULL;
if (filter->decompressionSession)
ICMDecompressionSessionRelease(filter->decompressionSession);
filter->decompressionSession = NULL;
return BaseOutputPinImpl_Inactive(&This->source);
if (filter->source.pin.peer)
IMemAllocator_Decommit(filter->source.pAllocator);
return S_OK;
}
static const struct strmbase_filter_ops filter_ops =