Zebediah Figura : winegstreamer: Fix pin enumeration order for the AVI and WAVE parsers.

Alexandre Julliard julliard at winehq.org
Fri Jan 24 16:14:11 CST 2020


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Jan 24 09:56:00 2020 -0600

winegstreamer: Fix pin enumeration order for the AVI and WAVE parsers.

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

---

 dlls/quartz/tests/avisplit.c   |  2 --
 dlls/quartz/tests/waveparser.c |  2 --
 dlls/winegstreamer/gstdemux.c  | 20 ++++++++++++++++----
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c
index 91f43e9790..0f5302c7d3 100644
--- a/dlls/quartz/tests/avisplit.c
+++ b/dlls/quartz/tests/avisplit.c
@@ -427,7 +427,6 @@ static void test_find_pin(void)
 
     hr = IBaseFilter_FindPin(filter, L"Stream 00", &pin);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
     ok(pin == pin2, "Expected pin %p, got %p.\n", pin2, pin);
     IPin_Release(pin);
     IPin_Release(pin2);
@@ -437,7 +436,6 @@ todo_wine
 
     hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
     ok(pin == pin2, "Expected pin %p, got %p.\n", pin2, pin);
     IPin_Release(pin);
     IPin_Release(pin2);
diff --git a/dlls/quartz/tests/waveparser.c b/dlls/quartz/tests/waveparser.c
index 39e0b52d4b..b1980c5ea5 100644
--- a/dlls/quartz/tests/waveparser.c
+++ b/dlls/quartz/tests/waveparser.c
@@ -421,7 +421,6 @@ static void test_find_pin(void)
 
     hr = IBaseFilter_FindPin(filter, L"output", &pin);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
     ok(pin == pin2, "Expected pin %p, got %p.\n", pin2, pin);
     IPin_Release(pin);
     IPin_Release(pin2);
@@ -431,7 +430,6 @@ todo_wine
 
     hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
     ok(pin == pin2, "Expected pin %p, got %p.\n", pin2, pin);
     IPin_Release(pin);
     IPin_Release(pin2);
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 350e50e359..901ed80dfe 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -60,6 +60,7 @@ struct gstdemux
 
     struct gstdemux_source **sources;
     unsigned int source_count;
+    BOOL enum_sink_first;
 
     LONGLONG filesize;
 
@@ -1214,10 +1215,20 @@ static struct strmbase_pin *gstdemux_get_pin(struct strmbase_filter *base, unsig
 {
     struct gstdemux *filter = impl_from_strmbase_filter(base);
 
-    if (!index)
-        return &filter->sink.pin;
-    else if (index <= filter->source_count)
-        return &filter->sources[index - 1]->pin.pin;
+    if (filter->enum_sink_first)
+    {
+        if (!index)
+            return &filter->sink.pin;
+        else if (index <= filter->source_count)
+            return &filter->sources[index - 1]->pin.pin;
+    }
+    else
+    {
+        if (index < filter->source_count)
+            return &filter->sources[index]->pin.pin;
+        else if (index == filter->source_count)
+            return &filter->sink.pin;
+    }
     return NULL;
 }
 
@@ -2510,6 +2521,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
     object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL);
     object->error_event = CreateEventW(NULL, TRUE, FALSE, NULL);
     object->init_gst = mpeg_splitter_init_gst;
+    object->enum_sink_first = TRUE;
     *phr = S_OK;
 
     TRACE("Created MPEG-1 splitter %p.\n", object);




More information about the wine-cvs mailing list