mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 05:57:27 +00:00
amstream: Check for an existing stream in IAMMultiMediaStream::AddMediaStream().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6b04ca02c0
commit
ca4f624e03
|
@ -289,6 +289,7 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac
|
|||
struct multimedia_stream *This = impl_from_IAMMultiMediaStream(iface);
|
||||
HRESULT hr;
|
||||
IAMMediaStream* pStream;
|
||||
IMediaStream *stream;
|
||||
|
||||
TRACE("mmstream %p, stream_object %p, id %s, flags %#x, ret_stream %p.\n",
|
||||
This, stream_object, debugstr_guid(PurposeId), dwFlags, ret_stream);
|
||||
|
@ -296,6 +297,12 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac
|
|||
if (!IsEqualGUID(PurposeId, &MSPID_PrimaryVideo) && !IsEqualGUID(PurposeId, &MSPID_PrimaryAudio))
|
||||
return MS_E_PURPOSEID;
|
||||
|
||||
if (IMediaStreamFilter_GetMediaStream(This->filter, PurposeId, &stream) == S_OK)
|
||||
{
|
||||
IMediaStream_Release(stream);
|
||||
return MS_E_PURPOSEID;
|
||||
}
|
||||
|
||||
if (dwFlags & AMMSF_ADDDEFAULTRENDERER)
|
||||
{
|
||||
if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo))
|
||||
|
|
|
@ -652,7 +652,7 @@ static void test_add_stream(void)
|
|||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream);
|
||||
todo_wine ok(hr == MS_E_PURPOSEID, "Got hr %#x.\n", hr);
|
||||
ok(hr == MS_E_PURPOSEID, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IAMMultiMediaStream_EnumMediaStreams(mmstream, 0, NULL);
|
||||
todo_wine ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||
|
@ -702,7 +702,7 @@ static void test_add_stream(void)
|
|||
todo_wine check_get_stream(mmstream, stream_filter, &test_mspid, (IMediaStream *)&teststream);
|
||||
|
||||
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream);
|
||||
todo_wine ok(hr == MS_E_PURPOSEID, "Got hr %#x.\n", hr);
|
||||
ok(hr == MS_E_PURPOSEID, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
|
Loading…
Reference in a new issue