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

winegstreamer: Set allocator properties for MPEG layer-3 decoder source.

parent d9b9af96
......@@ -921,9 +921,9 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control,
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Earlier versions used 16 buffers of lSampleSize bytes,
* later versions use 8 buffers of lSampleSize * 4 bytes. */
todo_wine ok(props.cBuffers == 16 || props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers);
todo_wine ok(props.cbBuffer == 2222 || props.cbBuffer == 8888, "Got size %ld.\n", props.cbBuffer);
todo_wine ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign);
ok(props.cBuffers == 16 || props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers);
ok(props.cbBuffer == 2222 || 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);
......@@ -933,7 +933,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);
......@@ -963,9 +963,9 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control,
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Earlier versions used 16 buffers of lSampleSize bytes,
* later versions use 8 buffers of lSampleSize * 4 bytes. */
todo_wine ok(props.cBuffers == 16 || props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers);
todo_wine ok(props.cbBuffer == 2222 || props.cbBuffer == 8888, "Got size %ld.\n", props.cbBuffer);
todo_wine ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign);
ok(props.cBuffers == 16 || props.cBuffers == 8, "Got %ld buffers.\n", props.cBuffers);
ok(props.cbBuffer == 2222 || 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);
......
......@@ -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 =
......
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