winegstreamer: Also return output with 2 channels for multichannel inputs from AAC decoder.

This commit is contained in:
Paul Gofman 2023-09-18 20:05:21 -06:00 committed by Alexandre Julliard
parent bb95f8c2f6
commit 416a273241
2 changed files with 9 additions and 1 deletions

View file

@ -2649,7 +2649,7 @@ static void test_aac_decoder_channels(const struct attribute_desc *input_type_de
}
ok(hr == MF_E_NO_MORE_TYPES, "got %#lx.\n", hr);
if (many_channels)
todo_wine ok(i == ARRAY_SIZE(expect_available_outputs) * 2, "got %lu media types.\n", i);
ok(i == ARRAY_SIZE(expect_available_outputs) * 2, "got %lu media types.\n", i);
else
ok(i == ARRAY_SIZE(expect_available_outputs), "got %lu media types.\n", i);
winetest_pop_context();

View file

@ -311,6 +311,14 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR
if (channel_count >= ARRAY_SIZE(default_channel_mask))
return MF_E_INVALIDMEDIATYPE;
if (channel_count > 2 && index >= ARRAY_SIZE(aac_decoder_output_types))
{
/* If there are more than two channels in the input type GetOutputAvailableType additionally lists
* types with 2 channels. */
index -= ARRAY_SIZE(aac_decoder_output_types);
channel_count = 2;
}
if (index >= ARRAY_SIZE(aac_decoder_output_types))
return MF_E_NO_MORE_TYPES;
index = ARRAY_SIZE(aac_decoder_output_types) - index - 1;