https://bugs.winehq.org/show_bug.cgi?id=51324
--- Comment #3 from Lorenzo Ferrillo lorenzofer@live.it --- Created attachment 70190 --> https://bugs.winehq.org/attachment.cgi?id=70190 amstream repsect renderallstreams flag
Hi Gijs A demo is not aviable.
The game creqate the multimeda_stream object and then call IAMMultiMediaStream_Initialize with type = 0, flags= 0x1 (AMMSF_NOGRAPHTHREAD) and nullptr graph.
Then it call IAMMultiMediaStream_OpenFile with the movie path and the flag 0x1 (AMMSF_RENDERALLSTREAMS)
Now before commit bdf860033860973bf2b516a1083d5bea86ad8c14 the codepath involved IGraphBuilder_Render(This->graph, This->ipin); that probably was creating the intermediate filters or renderers. And it worked.
After the commit it use IFilterGraph2_RenderEx with AM_RENDEREX_RENDERTOEXISTINGRENDERERS . This fails if no suitable renderer aren't present. And it's probably the intended behaviours of IAMMultiMediaStream_OpenFile in normal conditions.
But Imperium use OpenFile with AMMSF_RENDERALLSTREAMS. MSDN state that "The AMMSF_RENDERALLSTREAMS flag will create default rendering filters for video and audio if they do not exist" So it seems that in this specific case the filters are supposed to be created dynamically, and this application actually require this behaviour to be respected.
I tested that if I use IFilterGraph2_RenderEx passing 0 instead of AM_RENDEREX_RENDERTOEXISTINGRENDERERS when AMMSF_RENDERALLSTREAMS is passed the application works. It also works if it revert to use IGraphBuilder_Render for this specific case.
Attaching a patch for the first option. I don't know if this is what is supposed to happen, and testing the exact behaviours with the testbot may not be trivial.