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

Alexandre Julliard julliard at winehq.org
Tue Feb 22 16:06:49 CST 2022


Module: wine
Branch: master
Commit: 7b5dd73c30c892f8c85ea294ce27f35dad8b008f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7b5dd73c30c892f8c85ea294ce27f35dad8b008f

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Feb 21 23:13:18 2022 -0600

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

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/avisplit.c  | 13 +++++++++++--
 dlls/quartz/tests/mpegsplit.c | 13 +++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c
index 06c2f5fed3c..f295c074d5a 100644
--- a/dlls/quartz/tests/avisplit.c
+++ b/dlls/quartz/tests/avisplit.c
@@ -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);
diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c
index 0809c5f861f..5a9efe84551 100644
--- a/dlls/quartz/tests/mpegsplit.c
+++ b/dlls/quartz/tests/mpegsplit.c
@@ -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);




More information about the wine-cvs mailing list