Commit d5b79e6a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf: Adjust sample grabber sink flags in rateless mode.

parent c1c77f22
......@@ -862,6 +862,8 @@ static HRESULT WINAPI sample_grabber_sink_GetCharacteristics(IMFMediaSink *iface
return MF_E_SHUTDOWN;
*flags = MEDIASINK_FIXED_STREAMS;
if (grabber->ignore_clock)
*flags |= MEDIASINK_RATELESS;
return S_OK;
}
......
......@@ -2166,6 +2166,32 @@ todo_wine
refcount = IMFActivate_Release(activate);
ok(!refcount, "Unexpected refcount %u.\n", refcount);
/* Rateless mode with MF_SAMPLEGRABBERSINK_IGNORE_CLOCK. */
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);
hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio);
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM);
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = MFCreateSampleGrabberSinkActivate(media_type, &grabber_callback, &activate);
ok(hr == S_OK, "Failed to create grabber activate, hr %#x.\n", hr);
hr = IMFActivate_SetUINT32(activate, &MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, 1);
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = IMFActivate_ActivateObject(activate, &IID_IMFMediaSink, (void **)&sink);
ok(hr == S_OK, "Failed to activate object, hr %#x.\n", hr);
hr = IMFMediaSink_GetCharacteristics(sink, &flags);
ok(hr == S_OK, "Failed to get sink flags, hr %#x.\n", hr);
ok(flags & MEDIASINK_RATELESS, "Unexpected flags %#x.\n", flags);
IMFMediaSink_Release(sink);
IMFActivate_Release(activate);
IMFMediaType_Release(media_type);
hr = MFShutdown();
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment