There's not any reason to do this here; this should be handled with state change transitions. Since the pipeline is in the ready state, the only effect this will have is push_data() trying to run and failing since the decodebin sink pad isn't active.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 61e75b09234..727ffff8a6f 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -66,7 +66,7 @@ typedef struct GSTImpl { GstBus *bus; guint64 start, nextofs, nextpullofs, stop; ALLOCATOR_PROPERTIES props; - HANDLE no_more_pads_event, push_event; + HANDLE no_more_pads_event;
HANDLE push_thread; } GSTImpl; @@ -507,10 +507,6 @@ static DWORD CALLBACK push_data(LPVOID iface) else maxlen = This->stop;
- TRACE("Waiting..\n"); - - WaitForSingleObject(This->push_event, INFINITE); - TRACE("Starting..\n"); for (;;) { REFERENCE_TIME tStart, tStop; @@ -1155,10 +1151,6 @@ static HRESULT GST_Connect(GSTImpl *This, IPin *pConnectPin, ALLOCATOR_PROPERTIE
This->initial = FALSE;
- /* don't set active during test-play, as we don't want to push/pull data - * from the source yet */ - gst_pad_set_active(This->my_src, 1); - This->nextofs = This->nextpullofs = 0; return S_OK; } @@ -1185,7 +1177,6 @@ static void gstdemux_destroy(struct strmbase_filter *iface) HRESULT hr;
CloseHandle(filter->no_more_pads_event); - CloseHandle(filter->push_event);
/* Don't need to clean up output pins, disconnecting input pin will do that */ if (filter->sink.pConnectedTo) @@ -1246,7 +1237,6 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) This->ppPins = NULL; This->push_thread = NULL; This->no_more_pads_event = CreateEventW(NULL, 0, 0, NULL); - This->push_event = CreateEventW(NULL, 0, 0, NULL); This->bus = NULL;
This->sink.dir = PINDIR_INPUT; @@ -1864,7 +1854,6 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
filter->reader = NULL; filter->alloc = NULL; - ResetEvent(filter->push_event); if (SUCCEEDED(hr)) hr = IPin_QueryInterface(pReceivePin, &IID_IAsyncReader, (LPVOID *)&filter->reader); if (SUCCEEDED(hr)) @@ -1887,7 +1876,6 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, filter->sink.pConnectedTo = pReceivePin; IPin_AddRef(pReceivePin); hr = IMemAllocator_Commit(filter->alloc); - SetEvent(filter->push_event); } else { GST_RemoveOutputPins(filter); if (filter->reader)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 43 +++++++++++++++-------------------- 1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 727ffff8a6f..22eedfd4267 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -131,7 +131,7 @@ static gboolean amt_from_gst_caps_audio(GstCaps *caps, AM_MEDIA_TYPE *amt) if (!gst_audio_info_from_caps (&ainfo, caps)) return FALSE;
- wfe = CoTaskMemAlloc(sizeof(*wfe)); + wfe = heap_alloc(sizeof(*wfe)); wfx = (WAVEFORMATEX*)wfe; amt->majortype = MEDIATYPE_Audio; amt->subtype = MEDIASUBTYPE_PCM; @@ -196,7 +196,7 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) nom = vinfo.fps_n; denom = vinfo.fps_d;
- vih = CoTaskMemAlloc(sizeof(*vih)); + vih = heap_alloc(sizeof(*vih)); bih = &vih->bmiHeader;
amt->formattype = FORMAT_VideoInfo; @@ -215,14 +215,14 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) case 32: amt->subtype = MEDIASUBTYPE_RGB32; break; default: FIXME("Unknown bpp %u\n", bih->biBitCount); - CoTaskMemFree(vih); + heap_free(vih); return FALSE; } bih->biCompression = BI_RGB; } else { amt->subtype = MEDIATYPE_Video; if (!(amt->subtype.Data1 = gst_video_format_to_fourcc(vinfo.finfo->format))) { - CoTaskMemFree(vih); + heap_free(vih); return FALSE; } switch (amt->subtype.Data1) { @@ -1202,7 +1202,7 @@ static void gstdemux_destroy(struct strmbase_filter *iface) gst_object_unref(filter->bus); } strmbase_filter_cleanup(&filter->filter); - CoTaskMemFree(filter); + heap_free(filter); }
static const struct strmbase_filter_ops filter_ops = @@ -1213,7 +1213,7 @@ static const struct strmbase_filter_ops filter_ops =
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) { - GSTImpl *This; + GSTImpl *object;
if (!init_gstreamer()) { @@ -1223,30 +1223,23 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
mark_wine_thread();
- This = CoTaskMemAlloc(sizeof(*This)); - if (!This) + if (!(object = heap_alloc_zero(sizeof(*object)))) { *phr = E_OUTOFMEMORY; return NULL; } - memset(This, 0, sizeof(*This));
- strmbase_filter_init(&This->filter, &GST_Vtbl, outer, &CLSID_Gstreamer_Splitter, &filter_ops); + strmbase_filter_init(&object->filter, &GST_Vtbl, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
- This->cStreams = 0; - This->ppPins = NULL; - This->push_thread = NULL; - This->no_more_pads_event = CreateEventW(NULL, 0, 0, NULL); - This->bus = NULL; - - This->sink.dir = PINDIR_INPUT; - This->sink.filter = &This->filter; - lstrcpynW(This->sink.name, wcsInputPinName, ARRAY_SIZE(This->sink.name)); - This->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl; + object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL); + object->sink.dir = PINDIR_INPUT; + object->sink.filter = &object->filter; + lstrcpynW(object->sink.name, wcsInputPinName, ARRAY_SIZE(object->sink.name)); + object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl; *phr = S_OK;
- TRACE("Created GStreamer demuxer %p.\n", This); - return &This->filter.IUnknown_inner; + TRACE("Created GStreamer demuxer %p.\n", object); + return &object->filter.IUnknown_inner; }
static HRESULT WINAPI GST_Stop(IBaseFilter *iface) @@ -1764,7 +1757,7 @@ static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE * { GSTOutPin *pin, **new_array;
- if (!(new_array = CoTaskMemRealloc(filter->ppPins, (filter->cStreams + 1) * sizeof(*new_array)))) + if (!(new_array = heap_realloc(filter->ppPins, (filter->cStreams + 1) * sizeof(*new_array)))) return FALSE; filter->ppPins = new_array;
@@ -1773,7 +1766,7 @@ static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE *
strmbase_source_init(&pin->pin, &GST_OutputPin_Vtbl, &filter->filter, name, &output_BaseOutputFuncTable); - pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); + pin->pmt = heap_alloc(sizeof(AM_MEDIA_TYPE)); CopyMediaType(pin->pmt, mt); pin->caps_event = CreateEventW(NULL, FALSE, FALSE, NULL); pin->segment = gst_segment_new(); @@ -1805,7 +1798,7 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This) free_source_pin(This->ppPins[i]);
This->cStreams = 0; - CoTaskMemFree(This->ppPins); + heap_free(This->ppPins); This->ppPins = NULL; gst_element_set_bus(This->container, NULL); gst_object_unref(This->container);