mfreadwrite/tests: Add a test for reading from delected stream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8f0570b3d7
commit
979847e3a2
|
@ -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, ×tamp, &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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue