parse: Move variable to block where it's used

There was a dead assignment used outside of the bin/pipeline creation
which was confusing (and unused). Just move that variable to
where it is actually used.

(Note that that variable was not needed outside of that block since
the refactoring done in 2b33d33185 )
This commit is contained in:
Edward Hervey 2018-12-15 11:42:30 +01:00 committed by Edward Hervey
parent fe6c905659
commit 7c1d700384

View file

@ -1146,7 +1146,6 @@ priv_gst_parse_launch (const gchar *str, GError **error, GstParseContext *ctx,
graph_t g; graph_t g;
gchar *dstr; gchar *dstr;
GSList *walk; GSList *walk;
GstBin *bin = NULL;
GstElement *ret; GstElement *ret;
yyscan_t scanner; yyscan_t scanner;
@ -1209,6 +1208,7 @@ priv_gst_parse_launch (const gchar *str, GError **error, GstParseContext *ctx,
/* put all elements in our bin if necessary */ /* put all elements in our bin if necessary */
if(g.chain->elements->next){ if(g.chain->elements->next){
GstBin *bin;
if (flags & GST_PARSE_FLAG_PLACE_IN_BIN) if (flags & GST_PARSE_FLAG_PLACE_IN_BIN)
bin = GST_BIN (gst_element_factory_make ("bin", NULL)); bin = GST_BIN (gst_element_factory_make ("bin", NULL));
else else
@ -1226,8 +1226,6 @@ priv_gst_parse_launch (const gchar *str, GError **error, GstParseContext *ctx,
ret = (GstElement *) g.chain->elements->data; ret = (GstElement *) g.chain->elements->data;
g_slist_free (g.chain->elements); g_slist_free (g.chain->elements);
g.chain->elements=NULL; g.chain->elements=NULL;
if (GST_IS_BIN (ret))
bin = GST_BIN (ret);
gst_parse_free_chain (g.chain); gst_parse_free_chain (g.chain);
g.chain = NULL; g.chain = NULL;