Commit f595a3f9 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Remove unnecessary wg_parser their_sink pad.

parent f3b9ea7a
...@@ -66,7 +66,7 @@ struct wg_parser ...@@ -66,7 +66,7 @@ struct wg_parser
GstElement *container, *decodebin; GstElement *container, *decodebin;
GstBus *bus; GstBus *bus;
GstPad *my_src, *their_sink; GstPad *my_src;
guint64 file_size, start_offset, next_offset, stop_offset; guint64 file_size, start_offset, next_offset, stop_offset;
guint64 next_pull_offset; guint64 next_pull_offset;
...@@ -1679,11 +1679,8 @@ static NTSTATUS wg_parser_connect(void *args) ...@@ -1679,11 +1679,8 @@ static NTSTATUS wg_parser_connect(void *args)
out: out:
if (parser->container) if (parser->container)
gst_element_set_state(parser->container, GST_STATE_NULL); gst_element_set_state(parser->container, GST_STATE_NULL);
if (parser->their_sink) if (parser->my_src)
{ gst_object_unref(parser->my_src);
gst_object_unref(parser->their_sink);
parser->my_src = parser->their_sink = NULL;
}
for (i = 0; i < parser->stream_count; ++i) for (i = 0; i < parser->stream_count; ++i)
free_stream(parser->streams[i]); free_stream(parser->streams[i]);
...@@ -1725,8 +1722,7 @@ static NTSTATUS wg_parser_disconnect(void *args) ...@@ -1725,8 +1722,7 @@ static NTSTATUS wg_parser_disconnect(void *args)
gst_element_set_state(parser->container, GST_STATE_NULL); gst_element_set_state(parser->container, GST_STATE_NULL);
gst_object_unref(parser->my_src); gst_object_unref(parser->my_src);
gst_object_unref(parser->their_sink); parser->my_src = NULL;
parser->my_src = parser->their_sink = NULL;
pthread_mutex_lock(&parser->mutex); pthread_mutex_lock(&parser->mutex);
parser->sink_connected = false; parser->sink_connected = false;
...@@ -1762,7 +1758,6 @@ static NTSTATUS wg_parser_disconnect(void *args) ...@@ -1762,7 +1758,6 @@ static NTSTATUS wg_parser_disconnect(void *args)
static BOOL decodebin_parser_init_gst(struct wg_parser *parser) static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
{ {
GstElement *element; GstElement *element;
int ret;
if (!(element = create_element("decodebin", "base"))) if (!(element = create_element("decodebin", "base")))
return FALSE; return FALSE;
...@@ -1783,17 +1778,12 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) ...@@ -1783,17 +1778,12 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser); g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser);
g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser);
parser->their_sink = gst_element_get_static_pad(element, "sink");
pthread_mutex_lock(&parser->mutex); pthread_mutex_lock(&parser->mutex);
parser->no_more_pads = false; parser->no_more_pads = false;
pthread_mutex_unlock(&parser->mutex); pthread_mutex_unlock(&parser->mutex);
if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0) if (!link_src_to_element(parser->my_src, element))
{
GST_ERROR("Failed to link pads, error %d.", ret);
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
...@@ -1801,7 +1791,6 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) ...@@ -1801,7 +1791,6 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
static BOOL avi_parser_init_gst(struct wg_parser *parser) static BOOL avi_parser_init_gst(struct wg_parser *parser)
{ {
GstElement *element; GstElement *element;
int ret;
if (!(element = create_element("avidemux", "good"))) if (!(element = create_element("avidemux", "good")))
return FALSE; return FALSE;
...@@ -1812,17 +1801,12 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser) ...@@ -1812,17 +1801,12 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser)
g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser);
g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser);
parser->their_sink = gst_element_get_static_pad(element, "sink");
pthread_mutex_lock(&parser->mutex); pthread_mutex_lock(&parser->mutex);
parser->no_more_pads = false; parser->no_more_pads = false;
pthread_mutex_unlock(&parser->mutex); pthread_mutex_unlock(&parser->mutex);
if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0) if (!link_src_to_element(parser->my_src, element))
{
GST_ERROR("Failed to link pads, error %d.", ret);
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
...@@ -1838,12 +1822,8 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser) ...@@ -1838,12 +1822,8 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser)
gst_bin_add(GST_BIN(parser->container), element); gst_bin_add(GST_BIN(parser->container), element);
parser->their_sink = gst_element_get_static_pad(element, "sink"); if (!link_src_to_element(parser->my_src, element))
if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0)
{
GST_ERROR("Failed to link sink pads, error %d.", ret);
return FALSE; return FALSE;
}
if (!(stream = create_stream(parser))) if (!(stream = create_stream(parser)))
return FALSE; return FALSE;
...@@ -1872,12 +1852,8 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser) ...@@ -1872,12 +1852,8 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser)
gst_bin_add(GST_BIN(parser->container), element); gst_bin_add(GST_BIN(parser->container), element);
parser->their_sink = gst_element_get_static_pad(element, "sink"); if (!link_src_to_element(parser->my_src, element))
if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0)
{
GST_ERROR("Failed to link sink pads, error %d.", ret);
return FALSE; return FALSE;
}
if (!(stream = create_stream(parser))) if (!(stream = create_stream(parser)))
return FALSE; return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment