From: Anton Baskanov baskanov@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18773 Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/quartz/tests/mpeglayer3.c | 14 +++++++------- dlls/winegstreamer/quartz_transform.c | 8 +++++++- 2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/quartz/tests/mpeglayer3.c b/dlls/quartz/tests/mpeglayer3.c index 09267a5a007..d5c6dc7dbc3 100644 --- a/dlls/quartz/tests/mpeglayer3.c +++ b/dlls/quartz/tests/mpeglayer3.c @@ -919,9 +919,9 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control, ok(!!testsink->sink.pAllocator, "Expected an allocator.\n"); hr = IMemAllocator_GetProperties(testsink->sink.pAllocator, &props); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers); - todo_wine ok(props.cbBuffer == 8888, "Got size %ld.\n", props.cbBuffer); - todo_wine ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign); + ok(props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers); + ok(props.cbBuffer == 8888, "Got size %ld.\n", props.cbBuffer); + ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign); ok(!props.cbPrefix, "Got prefix %ld.\n", props.cbPrefix);
hr = IMemAllocator_GetBuffer(testsink->sink.pAllocator, &sample, NULL, NULL, 0); @@ -931,7 +931,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);
@@ -959,9 +959,9 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control, ok(testsink->sink.pAllocator == allocator, "Expected an allocator.\n"); hr = IMemAllocator_GetProperties(testsink->sink.pAllocator, &props); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers); - todo_wine ok(props.cbBuffer == 8888, "Got size %ld.\n", props.cbBuffer); - todo_wine ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign); + ok(props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers); + ok(props.cbBuffer == 8888, "Got size %ld.\n", props.cbBuffer); + ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign); ok(!props.cbPrefix, "Got prefix %ld.\n", props.cbPrefix);
IFilterGraph2_Disconnect(graph, source); diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c index c74938da082..6520f697ce4 100644 --- a/dlls/winegstreamer/quartz_transform.c +++ b/dlls/winegstreamer/quartz_transform.c @@ -803,7 +803,13 @@ static HRESULT mpeg_layer3_decoder_source_get_media_type(struct transform *filte
static HRESULT mpeg_layer3_decoder_source_decide_buffer_size(struct transform *filter, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props) { - return S_OK; + ALLOCATOR_PROPERTIES ret_props; + + props->cBuffers = max(props->cBuffers, 8); + props->cbBuffer = max(props->cbBuffer, filter->source.pin.mt.lSampleSize * 4); + props->cbAlign = max(props->cbAlign, 1); + + return IMemAllocator_SetProperties(allocator, props, &ret_props); }
static const struct transform_ops mpeg_layer3_decoder_transform_ops =