On Mon Dec 4 21:21:47 2023 +0000, Zebediah Figura wrote:
I don't like messing with compare_media_types(), though. It should be possible to add the lines I mentioned *before* calling compare_media_types(). I.e. test_stream_output_type() would look like this:
hr = IWMMediaProps_GetMediaType(media_props, mt, &ret_size); ok(hr == S_OK, "Got hr %#lx.\n", hr); if (IsEqualGUID(&expected->subtype, &MEDIASUBTYPE_WMV1)) { const VIDEOINFOHEADER *expect_vih = (const void *)expected->pbFormat; VIDEOINFOHEADER *vih = (void *)mt->pbFormat; todo_wine ok(vih->dwBitRate == expect_vih->dwBitRate, "Expected bit rate %lu, got %lu.\n", expect_vih->dwBitRate, vih->dwBitRate); vih->dwBitRate = expect_vih->dwBitRate; } ok(compare_media_types(mt, expected), "Media types didn't match.\n");
There's 200 ways to write any given piece of code.
I saw that one of the media types is const, and went for something that doesn't change them ...and forgot that the other media type is created in this function, and is safe to change. Yep, let's do that instead, much cleaner.