We don't do this in pull mode (and in general never have; avidemux and wavparse are two examples of GStreamer elements that don't flush the upstream pad when deactivating).
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index a4d49c75a1b..b2a20934837 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1424,12 +1424,10 @@ static gboolean activate_push(GstPad *pad, gboolean activate) EnterCriticalSection(&This->filter.filter_cs); if (!activate) { TRACE("Deactivating\n"); - IAsyncReader_BeginFlush(This->reader); if (This->push_thread) { pthread_join(This->push_thread, NULL); This->push_thread = 0; } - IAsyncReader_EndFlush(This->reader); if (This->filter.state == State_Stopped) This->nextofs = This->start; } else if (!This->push_thread) {
There's no good reason to do this; we're not protecting anything that isn't already protected by GStreamer locks.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index b2a20934837..e7178bb4dfc 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1421,7 +1421,6 @@ static gboolean activate_push(GstPad *pad, gboolean activate) { struct parser *This = gst_pad_get_element_private(pad);
- EnterCriticalSection(&This->filter.filter_cs); if (!activate) { TRACE("Deactivating\n"); if (This->push_thread) { @@ -1441,7 +1440,6 @@ static gboolean activate_push(GstPad *pad, gboolean activate) return FALSE; } } - LeaveCriticalSection(&This->filter.filter_cs); return TRUE; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e7178bb4dfc..5747cce1dd2 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1422,7 +1422,6 @@ static gboolean activate_push(GstPad *pad, gboolean activate) struct parser *This = gst_pad_get_element_private(pad);
if (!activate) { - TRACE("Deactivating\n"); if (This->push_thread) { pthread_join(This->push_thread, NULL); This->push_thread = 0; @@ -1432,7 +1431,6 @@ static gboolean activate_push(GstPad *pad, gboolean activate) } else if (!This->push_thread) { int ret;
- TRACE("Activating\n"); if ((ret = pthread_create(&This->push_thread, NULL, push_data, This))) { GST_ERROR("Failed to create push thread: %s", strerror(errno)); @@ -1447,7 +1445,7 @@ static gboolean activate_mode(GstPad *pad, GstObject *parent, GstPadMode mode, g { struct parser *filter = gst_pad_get_element_private(pad);
- TRACE("%s source pad for filter %p in %s mode.\n", + GST_DEBUG("%s source pad for filter %p in %s mode.", activate ? "Activating" : "Deactivating", filter, gst_pad_mode_get_name(mode));
switch (mode) {
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gst_cbs.c | 14 -------------- dlls/winegstreamer/gst_cbs.h | 2 -- dlls/winegstreamer/gstdemux.c | 8 +------- 3 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c index 5267091c5e1..90c34b1cb39 100644 --- a/dlls/winegstreamer/gst_cbs.c +++ b/dlls/winegstreamer/gst_cbs.c @@ -147,20 +147,6 @@ void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) call_cb(&cbdata); }
-gboolean activate_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) -{ - struct cb_data cbdata = { ACTIVATE_MODE }; - - cbdata.u.activate_mode_data.pad = pad; - cbdata.u.activate_mode_data.parent = parent; - cbdata.u.activate_mode_data.mode = mode; - cbdata.u.activate_mode_data.activate = activate; - - call_cb(&cbdata); - - return cbdata.u.activate_mode_data.ret; -} - gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) { struct cb_data cbdata = { QUERY_SINK }; diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h index 4afde78ba7d..cbd9a630885 100644 --- a/dlls/winegstreamer/gst_cbs.h +++ b/dlls/winegstreamer/gst_cbs.h @@ -31,7 +31,6 @@ typedef enum {
enum CB_TYPE { EXISTING_NEW_PAD, - ACTIVATE_MODE, QUERY_SINK, GSTDEMUX_MAX, BYTESTREAM_WRAPPER_PULL, @@ -114,7 +113,6 @@ void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN; void perform_cb_media_source(struct cb_data *data) DECLSPEC_HIDDEN;
void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; -gboolean activate_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN; GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN; void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 5747cce1dd2..ea6808ec113 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1581,7 +1581,7 @@ static HRESULT GST_Connect(struct parser *This, IPin *pConnectPin) This->my_src = gst_pad_new_from_static_template(&src_template, "quartz-src"); gst_pad_set_getrange_function(This->my_src, request_buffer_src); gst_pad_set_query_function(This->my_src, query_function); - gst_pad_set_activatemode_function(This->my_src, activate_mode_wrapper); + gst_pad_set_activatemode_function(This->my_src, activate_mode); gst_pad_set_event_function(This->my_src, event_src); gst_pad_set_element_private (This->my_src, This);
@@ -2511,12 +2511,6 @@ void perform_cb_gstdemux(struct cb_data *cbdata) existing_new_pad(data->element, data->pad, data->user); break; } - case ACTIVATE_MODE: - { - struct activate_mode_data *data = &cbdata->u.activate_mode_data; - cbdata->u.activate_mode_data.ret = activate_mode(data->pad, data->parent, data->mode, data->activate); - break; - } case QUERY_SINK: { struct query_sink_data *data = &cbdata->u.query_sink_data;