From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/qasf/asfreader.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index d9f50abcd6f..9a2e598b1e6 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -89,6 +89,27 @@ done: return hr; }
+static HRESULT asf_stream_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *media_type) +{ + struct asf_stream *stream = impl_from_strmbase_pin(iface); + struct asf_reader *filter = asf_reader_from_asf_stream(stream); + IWMOutputMediaProps *props; + HRESULT hr; + + TRACE("iface %p, media_type %p.\n", iface, media_type); + strmbase_dump_media_type(media_type); + + if (FAILED(IWMReader_GetOutputFormat(filter->reader, stream->index, 0, &props))) + return VFW_S_NO_MORE_ITEMS; + + hr = IWMOutputMediaProps_SetMediaType(props, (WM_MEDIA_TYPE *)media_type); + if (SUCCEEDED(hr)) + hr = IWMReader_SetOutputProps(filter->reader, stream->index, props); + + IWMOutputMediaProps_Release(props); + return hr; +} + static inline struct asf_reader *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, struct asf_reader, filter); @@ -162,6 +183,7 @@ static HRESULT WINAPI asf_reader_DecideBufferSize(struct strmbase_source *iface, static const struct strmbase_source_ops source_ops = { .base.pin_get_media_type = asf_stream_get_media_type, + .base.pin_query_accept = asf_stream_query_accept, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideBufferSize = asf_reader_DecideBufferSize,