Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/amstream/filter.c | 4 ++++ dlls/amstream/tests/amstream.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/amstream/filter.c b/dlls/amstream/filter.c index 0e09e492cb..0a06e78180 100644 --- a/dlls/amstream/filter.c +++ b/dlls/amstream/filter.c @@ -497,6 +497,10 @@ static HRESULT WINAPI filter_AddMediaStream(IMediaStreamFilter *iface, IAMMediaS if (FAILED(hr)) return hr;
+ hr = IAMMediaStream_JoinFilterGraph(pAMMediaStream, This->graph); + if (FAILED(hr)) + return hr; + This->streams[This->nb_streams] = pAMMediaStream; This->nb_streams++;
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 608bb2267f..0e9c40d118 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -686,6 +686,7 @@ static void test_add_stream(void) IEnumFilters *enum_filters; IBaseFilter *filters[3]; IGraphBuilder *graph; + FILTER_INFO info; ULONG ref, count; CLSID clsid; HRESULT hr; @@ -755,13 +756,18 @@ static void test_add_stream(void) hr = IAMMultiMediaStream_AddMediaStream(mmstream, (IUnknown *)&teststream, &IID_IUnknown, 0, &stream); ok(hr == MS_E_PURPOSEID, "Got hr %#x.\n", hr);
+ hr = IMediaStreamFilter_QueryFilterInfo(stream_filter, &info); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IAMMultiMediaStream_AddMediaStream(mmstream, (IUnknown *)&teststream, &test_mspid, 0, &stream); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(stream == (IMediaStream *)&teststream, "Streams didn't match.\n"); - if (hr == S_OK) IMediaStream_Release(stream); + IMediaStream_Release(stream); ok(teststream.mmstream == mmstream, "IAMMultiMediaStream objects didn't match.\n"); ok(teststream.filter == stream_filter, "IMediaStreamFilter objects didn't match.\n"); - todo_wine ok(!!teststream.graph, "Expected a non-NULL graph.\n"); + ok(teststream.graph == info.pGraph, "IFilterGraph objects didn't match.\n"); + + IFilterGraph_Release(info.pGraph);
check_enum_stream(mmstream, stream_filter, 0, video_stream); check_enum_stream(mmstream, stream_filter, 1, audio_stream);
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/amstream/tests/amstream.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 0e9c40d118..055661e8be 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -894,8 +894,6 @@ static void test_add_stream(void) hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!!graph, "Got graph %p.\n", graph); - hr = IAMMultiMediaStream_GetFilter(mmstream, &stream_filter); - ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IGraphBuilder_EnumFilters(graph, &enum_filters); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IEnumFilters_Next(enum_filters, 3, filters, &count); @@ -906,8 +904,7 @@ static void test_add_stream(void) hr = IBaseFilter_GetClassID(filters[0], &clsid); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(IsEqualGUID(&clsid, &CLSID_DSoundRender), "Got unexpected filter %s.\n", wine_dbgstr_guid(&clsid)); - IBaseFilter_Release(filters[0]); - IMediaStreamFilter_Release(stream_filter); + IBaseFilter_Release(filters[1]); IEnumFilters_Release(enum_filters); IGraphBuilder_Release(graph); } @@ -919,9 +916,10 @@ static void test_add_stream(void) AMMSF_ADDDEFAULTRENDERER, &audio_stream); ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
- IMediaStreamFilter_Release(stream_filter); ref = IAMMultiMediaStream_Release(mmstream); ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IMediaStreamFilter_Release(stream_filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); }
static void test_media_streams(void)
On 7/6/20 5:58 PM, Gijs Vermeulen wrote:
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com
dlls/amstream/tests/amstream.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 0e9c40d118..055661e8be 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -894,8 +894,6 @@ static void test_add_stream(void) hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!!graph, "Got graph %p.\n", graph);
hr = IAMMultiMediaStream_GetFilter(mmstream, &stream_filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IGraphBuilder_EnumFilters(graph, &enum_filters); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IEnumFilters_Next(enum_filters, 3, filters, &count);
@@ -906,8 +904,7 @@ static void test_add_stream(void) hr = IBaseFilter_GetClassID(filters[0], &clsid); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(IsEqualGUID(&clsid, &CLSID_DSoundRender), "Got unexpected filter %s.\n", wine_dbgstr_guid(&clsid));
IBaseFilter_Release(filters[0]);
Did you mean to remove this line?
IMediaStreamFilter_Release(stream_filter);
}IBaseFilter_Release(filters[1]); IEnumFilters_Release(enum_filters); IGraphBuilder_Release(graph);
@@ -919,9 +916,10 @@ static void test_add_stream(void) AMMSF_ADDDEFAULTRENDERER, &audio_stream); ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
- IMediaStreamFilter_Release(stream_filter); ref = IAMMultiMediaStream_Release(mmstream); ok(!ref, "Got outstanding refcount %d.\n", ref);
- ref = IMediaStreamFilter_Release(stream_filter);
- ok(!ref, "Got outstanding refcount %d.\n", ref);
}
static void test_media_streams(void)