Commit 979847e3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfreadwrite/tests: Add a test for reading from delected stream.

parent 8f0570b3
......@@ -894,6 +894,8 @@ static HRESULT source_reader_read_sample(struct source_reader *reader, DWORD ind
*stream_flags = MF_SOURCE_READERF_ERROR;
if (actual_index)
*actual_index = index;
if (timestamp)
*timestamp = 0;
return hr;
}
......
......@@ -891,6 +891,19 @@ todo_wine
ok(!!sample, "Expected sample object.\n");
IMFSample_Release(sample);
/* Request from deselected stream. */
hr = IMFSourceReader_SetStreamSelection(reader, 1, FALSE);
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
actual_index = 0;
stream_flags = 0;
hr = IMFSourceReader_ReadSample(reader, 1, 0, &actual_index, &stream_flags, &timestamp, &sample);
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
ok(actual_index == 1, "Unexpected stream index %u\n", actual_index);
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected stream flags %#x.\n", stream_flags);
ok(timestamp == 0, "Unexpected timestamp.\n");
ok(!sample, "Expected sample object.\n");
IMFSourceReader_Release(reader);
IMFMediaSource_Release(source);
......
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