[PATCH 7/7] winegstreamer: Commit allocator on pause in MPEG audio decoder.

Anton Baskanov baskanov at gmail.com
Mon May 2 06:14:21 CDT 2022


Signed-off-by: Anton Baskanov <baskanov at gmail.com>
---
 dlls/quartz/tests/mpegaudio.c         |  2 +-
 dlls/winegstreamer/quartz_transform.c | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c
index b2554d81cc6..2b2fb9a0832 100644
--- a/dlls/quartz/tests/mpegaudio.c
+++ b/dlls/quartz/tests/mpegaudio.c
@@ -1006,7 +1006,7 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control,
     ok(hr == S_OK, "Got hr %#lx.\n", hr);
 
     hr = IMemAllocator_GetBuffer(testsink->sink.pAllocator, &sample, NULL, NULL, 0);
-    todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
+    ok(hr == S_OK, "Got hr %#lx.\n", hr);
     if (hr == S_OK)
         IMediaSample_Release(sample);
 
diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c
index 183fb823d40..375c549aad5 100644
--- a/dlls/winegstreamer/quartz_transform.c
+++ b/dlls/winegstreamer/quartz_transform.c
@@ -66,10 +66,37 @@ static void transform_destroy(struct strmbase_filter *iface)
     free(filter);
 }
 
+static HRESULT transform_init_stream(struct strmbase_filter *iface)
+{
+    struct transform *filter = impl_from_strmbase_filter(iface);
+    HRESULT hr;
+
+    if (filter->source.pin.peer)
+    {
+        hr = IMemAllocator_Commit(filter->source.pAllocator);
+        if (FAILED(hr))
+            ERR("Failed to commit allocator, hr %#lx.\n", hr);
+    }
+
+    return S_OK;
+}
+
+static HRESULT transform_cleanup_stream(struct strmbase_filter *iface)
+{
+    struct transform *filter = impl_from_strmbase_filter(iface);
+
+    if (filter->source.pin.peer)
+        IMemAllocator_Decommit(filter->source.pAllocator);
+
+    return S_OK;
+}
+
 static const struct strmbase_filter_ops filter_ops =
 {
     .filter_get_pin = transform_get_pin,
     .filter_destroy = transform_destroy,
+    .filter_init_stream = transform_init_stream,
+    .filter_cleanup_stream = transform_cleanup_stream,
 };
 
 static HRESULT transform_sink_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt)
-- 
2.34.1




More information about the wine-devel mailing list