Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 2 ++ dlls/mfreadwrite/tests/mfplat.c | 13 +++++++++++++ 2 files changed, 15 insertions(+)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index bffe5cc47f..56ec036089 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -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; }
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index 081d94c7d5..9678f64efe 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -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);