Nikolay Sivov (@nsivov) commented about dlls/mfreadwrite/reader.c:
- UINT32 count;
 - HRESULT hr;
 - GUID key;
 - hr = IMFMediaType_GetCount(decoded_type, &count);
 - while (SUCCEEDED(hr) && count--)
 - {
 PropVariantInit(&value);hr = IMFMediaType_GetItemByIndex(decoded_type, count, &key, &value);if (SUCCEEDED(hr) && FAILED(IMFMediaType_GetItem(output_type, &key, NULL)))hr = IMFMediaType_SetItem(output_type, &key, &value);PropVariantClear(&value);- }
 - return hr;
 +}
Is that exactly what we need, to preserve existing attributes? If not, another option is to copy everything based on Compare() result.