Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/reader.c | 3 +++ dlls/mfreadwrite/tests/mfplat.c | 7 +++++++ 2 files changed, 10 insertions(+)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 17d274ebc8..e46b6003eb 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -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: diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index e03d74981a..c35cfa3c0c 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -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); }