Zebediah Figura : winegstreamer: Stop creating the filter if gstreamer fails to render.
Alexandre Julliard
julliard at winehq.org
Mon May 14 06:54:26 CDT 2018
Module: wine
Branch: stable
Commit: 037a7215968e2aac8fb171c27e63d5ba69bcdd9f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=037a7215968e2aac8fb171c27e63d5ba69bcdd9f
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Thu Feb 22 09:06:13 2018 -0600
winegstreamer: Stop creating the filter if gstreamer fails to render.
Otherwise the push_data() thread will run and try to use resources we
never allocated.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 5374d5ca59d4a15053d10ba1c70eb01241acdac7)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/winegstreamer/gstdemux.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index a19c64f..b48648c 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1103,7 +1103,6 @@ static void unknown_type(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer u
static HRESULT GST_Connect(GSTInPin *pPin, IPin *pConnectPin, ALLOCATOR_PROPERTIES *props)
{
GSTImpl *This = (GSTImpl*)pPin->pin.pinInfo.pFilter;
- HRESULT hr;
int ret, i;
LONGLONG avail, duration;
GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE(
@@ -1163,19 +1162,20 @@ static HRESULT GST_Connect(GSTInPin *pPin, IPin *pConnectPin, ALLOCATOR_PROPERTI
WaitForSingleObject(This->event, -1);
gst_element_get_state(This->container, NULL, NULL, -1);
- if (!This->cStreams) {
+ if (!This->cStreams)
+ {
FIXME("GStreamer could not find any streams\n");
- hr = E_FAIL;
- } else {
- gst_pad_query_duration(This->ppPins[0]->their_src, GST_FORMAT_TIME, &duration);
- for (i = 0; i < This->cStreams; ++i) {
- This->ppPins[i]->seek.llDuration = This->ppPins[i]->seek.llStop = duration / 100;
- This->ppPins[i]->seek.llCurrent = 0;
- if (!This->ppPins[i]->seek.llDuration)
- This->ppPins[i]->seek.dwCapabilities = 0;
- WaitForSingleObject(This->ppPins[i]->caps_event, -1);
- }
- hr = S_OK;
+ return E_FAIL;
+ }
+
+ gst_pad_query_duration(This->ppPins[0]->their_src, GST_FORMAT_TIME, &duration);
+ for (i = 0; i < This->cStreams; ++i)
+ {
+ This->ppPins[i]->seek.llDuration = This->ppPins[i]->seek.llStop = duration / 100;
+ This->ppPins[i]->seek.llCurrent = 0;
+ if (!This->ppPins[i]->seek.llDuration)
+ This->ppPins[i]->seek.dwCapabilities = 0;
+ WaitForSingleObject(This->ppPins[i]->caps_event, INFINITE);
}
*props = This->props;
@@ -1191,7 +1191,7 @@ static HRESULT GST_Connect(GSTInPin *pPin, IPin *pConnectPin, ALLOCATOR_PROPERTI
gst_pad_set_active(This->my_src, 1);
This->nextofs = This->nextpullofs = 0;
- return hr;
+ return S_OK;
}
static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface )
More information about the wine-cvs
mailing list