Nikolay Sivov (@nsivov) commented about dlls/mfmediaengine/main.c:
> {
> media_engine_set_flag(engine, FLAGS_ENGINE_SHUT_DOWN, TRUE);
> media_engine_clear_presentation(engine);
> + /* critical section can not be held during shutdown, as shut down requires all pending
> + * callbacks to complete, and some callbacks require this cs */
> + LeaveCriticalSection(&engine->cs);
> IMFMediaSession_Shutdown(engine->session);
> + EnterCriticalSection(&engine->cs);
> }
That's something else, unrelated to SVR work?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5924#note_88686
Nikolay Sivov (@nsivov) commented about dlls/mfmediaengine/main.c:
>
> IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_ENDED, 0, 0);
> break;
> +
> + case MEEndOfPresentation:
> + video_frame_sink_notify_end_of_presentation(engine->presentation.frame_sink);
> + break;
I think you can use MFSTREAMSINK_MARKER_ENDOFSEGMENT for this. The way you did it sort of bypasses normal session flow, there is potentially unknown number of pending samples in the pipeline once MEEndOfPresentation is received. This is only a problem if for some reason earlier node somehow requests more times than the sink. ENDOFSEGMENT is already used in EVR, and that seems to work.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5924#note_88685
Nikolay Sivov (@nsivov) commented about dlls/mfmediaengine/main.c:
>
> static void free_media_engine(struct media_engine *engine)
> {
> + EnterCriticalSection(&engine->cs);
This helper is called when refcount is already 0, nothing else should be using it at this point.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5924#note_88684