The phrasing is a bit odd, since if I'm not mistaken, the media type for a given IMediaSample can't change. But that raises a question: is it actually per-sample, or is it about the surface desc on two consecutive samples for the same stream? That is, what if you create two samples with the same surface desc and then call GetMediaType() on both of them? ``` @@ -2288,6 +2290,12 @@ static HRESULT WINAPI media_sample_GetMediaType(IMediaSample *iface, AM_MEDIA_TY TRACE("sample %p, ret_mt %p.\n", sample, ret_mt); + if (!sample->needs_mt) + { + *ret_mt = NULL; + return S_FALSE; + } + /* Note that this usually matches the media type we pass to QueryAccept(), * but not if there's a sub-rect. * That's amstream just breaking the DirectShow rules. ``` Are we sure this is correct? What if you call GetMediaType() twice without releasing the sample? What if you don't call GetMediaType() the first time you retrieve the sample but you do call it the second time? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10583#note_135600