Nikolay Sivov : mfplat/allocator: Keep a reference to initialization attributes.
Alexandre Julliard
julliard at winehq.org
Wed Feb 3 15:39:29 CST 2021
Module: wine
Branch: master
Commit: d100d92f93ab607781c4254719e5614dc25847ee
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d100d92f93ab607781c4254719e5614dc25847ee
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Feb 3 14:28:01 2021 +0300
mfplat/allocator: Keep a reference to initialization attributes.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mfplat/sample.c | 9 ++++++++-
dlls/mfplat/tests/mfplat.c | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c
index 266bb6f0726..8a0281abf6c 100644
--- a/dlls/mfplat/sample.c
+++ b/dlls/mfplat/sample.c
@@ -75,6 +75,8 @@ struct sample_allocator
unsigned int buffer_count;
} frame_desc;
+ IMFAttributes *attributes;
+
unsigned int free_sample_count;
unsigned int cold_sample_count;
struct list free_samples;
@@ -1129,6 +1131,8 @@ static ULONG WINAPI sample_allocator_Release(IMFVideoSampleAllocatorEx *iface)
IDirect3DDeviceManager9_Release(allocator->d3d9_device_manager);
if (allocator->dxgi_device_manager)
IMFDXGIDeviceManager_Release(allocator->dxgi_device_manager);
+ if (allocator->attributes)
+ IMFAttributes_Release(allocator->attributes);
sample_allocator_release_samples(allocator);
DeleteCriticalSection(&allocator->cs);
heap_free(allocator);
@@ -1348,7 +1352,10 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
max_sample_count = max(1, max_sample_count);
if (attributes)
- FIXME("Initialization attributes ignored.\n");
+ {
+ allocator->attributes = attributes;
+ IMFAttributes_AddRef(allocator->attributes);
+ }
allocator->frame_desc.d3d9_format = subtype.Data1;
allocator->frame_desc.dxgi_format = MFMapDX9FormatToDXGIFormat(allocator->frame_desc.d3d9_format);
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 3d6e553ce35..ed862ab9bdb 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -6442,7 +6442,6 @@ todo_wine
EXPECT_REF(attributes, 1);
hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(allocatorex, 0, 0, attributes, video_type);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
-todo_wine
EXPECT_REF(attributes, 2);
count = 0;
More information about the wine-cvs
mailing list