Skip to content

Commit 00aba3a

Browse files
author
Brendan McGrath
committed
amstream: Return connected media subtype in enum if connected.
(cherry picked from commit b079b336ba61e92b00aa99dfc26446d7429ab8bb) CW-Bug-Id: #26731
1 parent f0c8b97 commit 00aba3a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

dlls/amstream/ddrawstream.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,9 @@ static HRESULT WINAPI enum_media_types_Next(IEnumMediaTypes *iface, ULONG count,
988988
mts[0] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
989989
memset(mts[0], 0, sizeof(AM_MEDIA_TYPE));
990990
mts[0]->majortype = MEDIATYPE_Video;
991-
if (enum_media_types->stream->format.flags & DDSD_PIXELFORMAT)
991+
if (enum_media_types->stream->peer)
992+
mts[0]->subtype = enum_media_types->stream->mt.subtype;
993+
else if (enum_media_types->stream->format.flags & DDSD_PIXELFORMAT)
992994
subtype_from_pf(&mts[0]->subtype, &format->pf);
993995
else
994996
mts[0]->subtype = MEDIASUBTYPE_RGB8;

dlls/amstream/tests/amstream.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3185,10 +3185,8 @@ static void test_media_types(void)
31853185
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, &count);
31863186
ok(hr == S_OK, "Got hr %#lx.\n", hr);
31873187
ok(IsEqualGUID(&pmt->majortype, &MEDIATYPE_Video), "Unexpected media type %s.\n", wine_dbgstr_guid(&pmt->majortype));
3188-
todo_wine
31893188
ok(IsEqualGUID(&pmt->subtype, rejected_subtypes[i].guid), "Unexpected media subtype %s.\n", wine_dbgstr_guid(&pmt->subtype));
31903189
ok(IsEqualGUID(&pmt->formattype, &GUID_NULL), "Unexpected media formattype %s.\n", wine_dbgstr_guid(&pmt->formattype));
3191-
todo_wine
31923190
ok(pmt->lSampleSize == 40000 * rejected_subtypes[i].bytes_per_pixel, "Unexpected sample size %lu.\n", pmt->lSampleSize);
31933191
DeleteMediaType(pmt);
31943192

0 commit comments

Comments
 (0)