Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 27e859fa82d..117e2d2e785 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3106,11 +3106,17 @@ todo_wine hr = MFCreateMediaType(&mediatype); ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);
+ /* Actual return value is MF_E_ATRIBUTENOTFOUND triggered by missing MF_MT_MAJOR_TYPE */ hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, mediatype, NULL); -todo_wine - ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
- IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, mediatype, NULL); + ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr); + + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, mediatype, NULL); ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 117e2d2e785..41ca385cc2b 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2925,11 +2925,11 @@ static void test_sar(void) { IMFPresentationClock *present_clock, *present_clock2; IMFMediaType *mediatype, *mediatype2, *mediatype3; + IMFClockStateSink *state_sink, *state_sink2; IMFMediaTypeHandler *handler, *handler2; IMFPresentationTimeSource *time_source; IMFSimpleAudioVolume *simple_volume; IMFAudioStreamVolume *stream_volume; - IMFClockStateSink *state_sink; IMFMediaSink *sink, *sink2; IMFStreamSink *stream_sink; IMFAttributes *attributes; @@ -2967,6 +2967,14 @@ todo_wine
if (SUCCEEDED(hr)) { + hr = IMFPresentationTimeSource_QueryInterface(time_source, &IID_IMFClockStateSink, (void **)&state_sink2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFPresentationTimeSource_QueryInterface(time_source, &IID_IMFClockStateSink, (void **)&state_sink); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(state_sink == state_sink2, "Unexpected clock sink.\n"); + IMFClockStateSink_Release(state_sink2); + IMFClockStateSink_Release(state_sink); + hr = IMFPresentationTimeSource_GetUnderlyingClock(time_source, &clock); ok(hr == MF_E_NO_CLOCK, "Unexpected hr %#x.\n", hr);
@@ -3008,6 +3016,9 @@ if (SUCCEEDED(hr)) check_interface(sink, &IID_IMFMediaSinkPreroll, TRUE); check_interface(sink, &IID_IMFMediaEventGenerator, TRUE); check_interface(sink, &IID_IMFClockStateSink, TRUE); + check_interface(sink, &IID_IMFGetService, TRUE); + todo_wine check_interface(sink, &IID_IMFPresentationTimeSource, TRUE); + check_service_interface(sink, &MR_POLICY_VOLUME_SERVICE, &IID_IMFSimpleAudioVolume, TRUE);
/* Clock */ hr = IMFMediaSink_QueryInterface(sink, &IID_IMFClockStateSink, (void **)&state_sink); @@ -3057,6 +3068,8 @@ todo_wine ok(hr == S_OK, "Failed to get a stream, hr %#x.\n", hr);
check_interface(stream_sink, &IID_IMFMediaEventGenerator, TRUE); + check_interface(stream_sink, &IID_IMFMediaTypeHandler, TRUE); + todo_wine check_interface(stream_sink, &IID_IMFGetService, TRUE);
hr = IMFStreamSink_GetIdentifier(stream_sink, &id); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 19da9a24464..6d4b58289d8 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -1022,7 +1022,7 @@ static void session_pause(struct media_session *session) { case SESSION_STATE_STARTED:
- /* Transition in two steps - pause clock, wait for sinks and pause sources. */ + /* Transition in two steps - pause the clock, wait for sinks, then pause sources. */ if (SUCCEEDED(hr = IMFPresentationClock_Pause(session->clock))) session->state = SESSION_STATE_PAUSING_SINKS;
@@ -1061,7 +1061,7 @@ static void session_stop(struct media_session *session) case SESSION_STATE_STARTED: case SESSION_STATE_PAUSED:
- /* Transition in two steps - pause clock, wait for sinks and pause sources. */ + /* Transition in two steps - stop the clock, wait for sinks, then stop sources. */ IMFPresentationClock_GetTime(session->clock, &session->presentation.clock_stop_time); if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) session->state = SESSION_STATE_STOPPING_SINKS;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index 47a506a94c6..3479bade251 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -2137,6 +2137,12 @@ static HRESULT WINAPI video_renderer_event_sink_Notify(IMediaEventSink *iface, L MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL); } } + else if (event == EC_DISPLAY_CHANGED) + { + for (idx = 0; idx < renderer->stream_count; ++idx) + IMFMediaEventQueue_QueueEventParamVar(renderer->streams[idx]->event_queue, + MEStreamSinkDeviceChanged, &GUID_NULL, S_OK, NULL); + } else if (event >= EC_USER) { PROPVARIANT code;