mf: Return sink flags for SAR.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-04-07 10:54:59 +03:00 committed by Alexandre Julliard
parent 509bef711f
commit 0070860ef8
2 changed files with 21 additions and 3 deletions

View File

@ -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,

View File

@ -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);