[PATCH 2/5] winegstreamer: Check for failure from gst_element_set_state() instead of counting pads.

Zebediah Figura z.figura12 at gmail.com
Tue Feb 20 20:12:59 CST 2018


Especially since pads might be exposed before failure is reported.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/winegstreamer/gstdemux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index ea61ed5..0fee556 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1160,10 +1160,10 @@ static HRESULT GST_Connect(GSTInPin *pPin, IPin *pConnectPin, ALLOCATOR_PROPERTI
     ResetEvent(This->event);
     gst_element_set_state(This->container, GST_STATE_PLAYING);
     WaitForSingleObject(This->event, -1);
-    gst_element_get_state(This->container, NULL, NULL, -1);
+    ret = gst_element_get_state(This->container, NULL, NULL, -1);
 
-    if (!This->cStreams) {
-        FIXME("GStreamer could not find any streams\n");
+    if (ret == GST_STATE_CHANGE_FAILURE) {
+        ERR("GStreamer failed to play stream\n");
         return E_FAIL;
     } else {
         gst_pad_query_duration(This->ppPins[0]->their_src, GST_FORMAT_TIME, &duration);
-- 
2.7.4




More information about the wine-devel mailing list