Commit 96c8be00 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

winegstreamer: Use codec format in stream_props_GetMediaType.

parent 6c424b7e
......@@ -544,12 +544,16 @@ static HRESULT WINAPI stream_props_GetType(IWMMediaProps *iface, GUID *major_typ
static HRESULT WINAPI stream_props_GetMediaType(IWMMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size)
{
struct stream_config *config = impl_from_IWMMediaProps(iface);
const struct wg_format *format;
struct wg_format codec_format;
const DWORD req_size = *size;
AM_MEDIA_TYPE stream_mt;
TRACE("iface %p, mt %p, size %p.\n", iface, mt, size);
if (!amt_from_wg_format(&stream_mt, &config->stream->format, true))
wg_parser_stream_get_codec_format(config->stream->wg_stream, &codec_format);
format = (codec_format.major_type != WG_MAJOR_TYPE_UNKNOWN) ? &codec_format : &config->stream->format;
if (!amt_from_wg_format(&stream_mt, format, true))
return E_OUTOFMEMORY;
*size = sizeof(stream_mt) + stream_mt.cbFormat;
......
......@@ -1549,7 +1549,7 @@ static void test_sync_reader_types(void)
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio))
test_stream_media_props(config, &MEDIATYPE_Audio, &MEDIASUBTYPE_MSAUDIO1, &FORMAT_WaveFormatEx, TRUE);
else
test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, TRUE);
test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, FALSE);
ref = IWMStreamConfig_Release(config);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
......@@ -3429,7 +3429,7 @@ static void test_async_reader_types(void)
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio))
test_stream_media_props(config, &MEDIATYPE_Audio, &MEDIASUBTYPE_MSAUDIO1, &FORMAT_WaveFormatEx, TRUE);
else
test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, TRUE);
test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, FALSE);
ref = IWMStreamConfig_Release(config);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
......
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