On 5/27/22 09:46, Rémi Bernon wrote:
+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;
+}
This seems wrong; QueryAccept() isn't supposed to modify any state, and it can be called at any time.
Given that there's apparently no WM interface for this functionality I suspect that we'll have to implement it manually (after writing tests to find out what the correct functionality even is), if it's worth implementing. Which it may not be—calling QueryAccept() on the source pin isn't part of the usual connection process, and our fallback implementation returns S_OK anyway.