From ebd789a0a6507978a6a3aeabc841709b791de8d9 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Thu, 11 Jul 2024 13:29:29 +1000 Subject: [PATCH 1/2] mf: Retry PROCESSINPUTNOTIFY if TRANSFORM_TYPE_NOT_SET is returned. Send INVALIDATEMEDIATYPE to allow the transform type to be set before retrying PROCESSINPUTNOTIFY. --- dlls/mf/evr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index db7053a1405..a13c2d7e89b 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -416,7 +416,10 @@ static HRESULT WINAPI video_stream_sink_ProcessSample(IMFStreamSink *iface, IMFS } if (SUCCEEDED(IMFTransform_ProcessInput(stream->parent->mixer, stream->id, sample, 0))) - IMFVideoPresenter_ProcessMessage(stream->parent->presenter, MFVP_MESSAGE_PROCESSINPUTNOTIFY, 0); + { + while (hr == S_OK && (hr = IMFVideoPresenter_ProcessMessage(stream->parent->presenter, MFVP_MESSAGE_PROCESSINPUTNOTIFY, 0)) == MF_E_TRANSFORM_TYPE_NOT_SET) + hr = IMFVideoPresenter_ProcessMessage(stream->parent->presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0); + } if (stream->flags & EVR_STREAM_PREROLLING) { From f39e0b2bd6163b2ab2270d56366353dd3ee61673 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Fri, 2 Aug 2024 11:46:22 +1000 Subject: [PATCH 2/2] mf: Send MEError when IMFStreamSink_ProcessSample fails. --- dlls/mf/session.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 3c989249229..e24cc6376b4 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -3706,7 +3706,10 @@ static void session_deliver_sample_to_node(struct media_session *session, struct if (sample) { if (FAILED(hr = IMFStreamSink_ProcessSample(topo_node->object.sink_stream, sample))) + { WARN("Stream sink failed to process sample, hr %#lx.\n", hr); + IMFMediaEventQueue_QueueEventParamVar(session->event_queue, MEError, &GUID_NULL, hr, NULL); + } } else if (FAILED(hr = IMFStreamSink_PlaceMarker(topo_node->object.sink_stream, MFSTREAMSINK_MARKER_ENDOFSEGMENT, NULL, NULL)))