Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/wm_syncreader.c | 10 ++++--- dlls/wmvcore/tests/wmvcore.c | 43 +++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/dlls/winegstreamer/wm_syncreader.c b/dlls/winegstreamer/wm_syncreader.c index 73bbf18898f..96754d107de 100644 --- a/dlls/winegstreamer/wm_syncreader.c +++ b/dlls/winegstreamer/wm_syncreader.c @@ -296,11 +296,13 @@ static HRESULT WINAPI WMSyncReader_SetRangeByFrame(IWMSyncReader2 *iface, WORD s return E_NOTIMPL; }
-static HRESULT WINAPI WMSyncReader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD stream_num, BOOL compressed) +static HRESULT WINAPI WMSyncReader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD stream_number, BOOL compressed) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); - FIXME("(%p)->(%u %x): stub!\n", This, stream_num, compressed); - return E_NOTIMPL; + struct sync_reader *reader = impl_from_IWMSyncReader2(iface); + + TRACE("reader %p, stream_index %u, compressed %d.\n", reader, stream_number, compressed); + + return wm_reader_set_read_compressed(&reader->reader, stream_number, compressed); }
static HRESULT WINAPI WMSyncReader_SetStreamsSelected(IWMSyncReader2 *iface, diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 8e10d9f5e89..9ddd53ab9e7 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -821,6 +821,45 @@ static void test_sync_reader_selection(IWMSyncReader *reader) ok(hr == S_OK, "Got hr %#x.\n", hr); }
+static void test_sync_reader_compressed(IWMSyncReader *reader) +{ + QWORD pts, duration; + INSSBuffer *sample; + WORD stream_number; + DWORD flags; + HRESULT hr; + + hr = IWMSyncReader_SetReadStreamSamples(reader, 0, TRUE); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + hr = IWMSyncReader_SetReadStreamSamples(reader, 1, TRUE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IWMSyncReader_SetReadStreamSamples(reader, 2, TRUE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IWMSyncReader_SetReadStreamSamples(reader, 3, TRUE); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + + hr = IWMSyncReader_SetRange(reader, 0, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IWMSyncReader_GetNextSample(reader, 0, &sample, &pts, &duration, &flags, NULL, &stream_number); + ok(hr == S_OK, "Got hr %#x.\n", hr); + INSSBuffer_Release(sample); + + for (;;) + { + hr = IWMSyncReader_GetNextSample(reader, 0, &sample, &pts, &duration, &flags, NULL, &stream_number); + if (hr == NS_E_NO_MORE_SAMPLES) + break; + ok(hr == S_OK, "Got hr %#x.\n", hr); + INSSBuffer_Release(sample); + } + + hr = IWMSyncReader_SetReadStreamSamples(reader, 1, FALSE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IWMSyncReader_SetReadStreamSamples(reader, 2, FALSE); + ok(hr == S_OK, "Got hr %#x.\n", hr); +} + static void test_sync_reader_streaming(void) { DWORD size, capacity, flags, output_number, expect_output_number; @@ -883,9 +922,6 @@ static void test_sync_reader_streaming(void)
ref = IWMStreamConfig_Release(config); ok(!ref, "Got outstanding refcount %d.\n", ref); - - hr = IWMSyncReader_SetReadStreamSamples(reader, stream_numbers[i], FALSE); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); }
hr = IWMProfile_GetStream(profile, 2, &config); @@ -1028,6 +1064,7 @@ static void test_sync_reader_streaming(void) ok(hr == S_OK, "Got hr %#x.\n", hr);
test_sync_reader_selection(reader); + test_sync_reader_compressed(reader);
test_reader_attributes(profile);