quartz/tests: Reset sink event counters when initializing the stream.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-02-21 23:13:18 -06:00 committed by Alexandre Julliard
parent 5815ba4548
commit 7b5dd73c30
2 changed files with 22 additions and 4 deletions

View File

@ -836,10 +836,21 @@ static void testfilter_destroy(struct strmbase_filter *iface)
strmbase_filter_cleanup(&filter->filter);
}
static HRESULT testfilter_init_stream(struct strmbase_filter *iface)
{
struct testfilter *filter = impl_from_strmbase_filter(iface);
filter->new_segment_count = 0;
filter->eos_count = 0;
filter->sample_count = 0;
return S_OK;
}
static const struct strmbase_filter_ops testfilter_ops =
{
.filter_get_pin = testfilter_get_pin,
.filter_destroy = testfilter_destroy,
.filter_init_stream = testfilter_init_stream,
};
static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
@ -1689,7 +1700,6 @@ static void test_streaming(void)
ok(WaitForSingleObject(testsink.eos_event, 100) == WAIT_TIMEOUT, "Got more than one EOS.\n");
ok(testsink.sample_count, "Expected at least one sample.\n");
testsink.sample_count = testsink.eos_count = 0;
hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMediaControl_Pause(control);
@ -1716,7 +1726,6 @@ static void test_streaming(void)
ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
testsink.sample_count = testsink.eos_count = 0;
hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMediaControl_Pause(control);

View File

@ -1125,10 +1125,21 @@ static void testfilter_destroy(struct strmbase_filter *iface)
CloseHandle(filter->eos_event);
}
static HRESULT testfilter_init_stream(struct strmbase_filter *iface)
{
struct testfilter *filter = impl_from_strmbase_filter(iface);
filter->new_segment_count = 0;
filter->eos_count = 0;
filter->sample_count = 0;
return S_OK;
}
static const struct strmbase_filter_ops testfilter_ops =
{
.filter_get_pin = testfilter_get_pin,
.filter_destroy = testfilter_destroy,
.filter_init_stream = testfilter_init_stream,
};
static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
@ -1842,7 +1853,6 @@ static void test_streaming(void)
ok(WaitForSingleObject(testsink.eos_event, 100) == WAIT_TIMEOUT, "Got more than one EOS.\n");
ok(testsink.sample_count, "Expected at least one sample.\n");
testsink.sample_count = testsink.eos_count = 0;
hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMediaControl_Pause(control);
@ -1869,7 +1879,6 @@ static void test_streaming(void)
ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
testsink.sample_count = testsink.eos_count = 0;
hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMediaControl_Pause(control);