Commit ac39b313 authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Alexandre Julliard

mfreadwrite: Accept new media type only when format data are equal.

parent aef6a234
......@@ -1578,7 +1578,7 @@ static HRESULT source_reader_set_compatible_media_type(struct source_reader *rea
return MF_E_INVALIDMEDIATYPE;
/* No need for a decoder or type change. */
if (flags & MF_MEDIATYPE_EQUAL_FORMAT_TYPES)
if (flags & MF_MEDIATYPE_EQUAL_FORMAT_DATA)
return S_OK;
if (FAILED(hr = source_reader_get_source_type_handler(reader, index, &type_handler)))
......@@ -1586,7 +1586,7 @@ static HRESULT source_reader_set_compatible_media_type(struct source_reader *rea
while (!type_set && IMFMediaTypeHandler_GetMediaTypeByIndex(type_handler, i++, &native_type) == S_OK)
{
static const DWORD compare_flags = MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_TYPES;
static const DWORD compare_flags = MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_DATA;
if (SUCCEEDED(IMFMediaType_IsEqual(native_type, type, &flags)) && (flags & compare_flags) == compare_flags)
{
......
......@@ -1062,7 +1062,6 @@ static void test_source_reader_from_media_source(void)
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type);
todo_wine
ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected success setting current media type, hr %#x.\n", hr);
IMFMediaType_Release(media_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment