Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/sar.c | 11 +++++++++-- dlls/mf/tests/mf.c | 13 ++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c index 3c6820cd68..90098b93bd 100644 --- a/dlls/mf/sar.c +++ b/dlls/mf/sar.c @@ -99,9 +99,16 @@ static ULONG WINAPI audio_renderer_sink_Release(IMFMediaSink *iface)
static HRESULT WINAPI audio_renderer_sink_GetCharacteristics(IMFMediaSink *iface, DWORD *flags) { - FIXME("%p, %p.\n", iface, flags); + struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, flags); + + if (renderer->is_shut_down) + return MF_E_SHUTDOWN; + + *flags = MEDIASINK_FIXED_STREAMS | MEDIASINK_CAN_PREROLL; + + return S_OK; }
static HRESULT WINAPI audio_renderer_sink_AddStreamSink(IMFMediaSink *iface, DWORD stream_sink_id, diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 578c5bcaf7..e278f73ef1 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2639,6 +2639,7 @@ static void test_sar(void) MFCLOCK_STATE state; DWORD flags, count; IMFClock *clock; + IUnknown *unk; HRESULT hr;
hr = CoInitialize(NULL); @@ -2693,6 +2694,14 @@ if (SUCCEEDED(hr)) ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(count == 1, "Unexpected count %u.\n", count);
+ hr = IMFMediaSink_GetCharacteristics(sink, &flags); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(flags == (MEDIASINK_FIXED_STREAMS | MEDIASINK_CAN_PREROLL), "Unexpected flags %#x.\n", flags); + + hr = IMFMediaSink_QueryInterface(sink, &IID_IMFMediaSinkPreroll, (void **)&unk); + ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + IUnknown_Release(unk); + /* Shutdown */ hr = IMFMediaSink_Shutdown(sink); ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr); @@ -2712,6 +2721,9 @@ if (SUCCEEDED(hr)) hr = IMFMediaSink_GetStreamSinkCount(sink, &count); ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ hr = IMFMediaSink_GetCharacteristics(sink, &flags); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr); + IMFMediaSink_Release(sink);
/* Activation */ @@ -2727,7 +2739,6 @@ if (SUCCEEDED(hr)) IMFMediaSink_Release(sink2);
hr = IMFMediaSink_GetCharacteristics(sink, &flags); -todo_wine ok(hr == S_OK, "Failed to get sink flags, hr %#x.\n", hr);
hr = IMFActivate_ShutdownObject(activate);