mfreadwrite: Block recurring flush calls in async mode when flush is pending.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Nikolay Sivov 2020-04-03 19:25:11 +03:00 committed by Alexandre Julliard
parent 42edc14e04
commit ee7b317293
2 changed files with 10 additions and 0 deletions

View File

@ -1710,6 +1710,9 @@ static HRESULT source_reader_flush_async(struct source_reader *reader, unsigned
unsigned int stream_index;
HRESULT hr;
if (reader->flags & SOURCE_READER_FLUSHING)
return MF_E_INVALIDREQUEST;
switch (index)
{
case MF_SOURCE_READER_FIRST_VIDEO_STREAM:

View File

@ -951,6 +951,13 @@ todo_wine
hr = IMFSourceReader_ReadSample(reader, 0, 0, NULL, NULL, NULL, &sample);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
/* Flush() arguments validation. */
hr = IMFSourceReader_Flush(reader, 123);
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
hr = IMFSourceReader_ReadSample(reader, 0, 0, NULL, NULL, NULL, NULL);
ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
IMFSourceReader_Release(reader);
}