Commit f91f4348 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

winegstreamer: Commit allocator on pause in MPEG audio decoder.

parent 19339817
......@@ -1005,7 +1005,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);
......
......@@ -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)
......
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