From a24db77217b40ae1b09584389cc9bda32428ee91 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Mon, 13 Oct 2014 00:03:55 +0300 Subject: [PATCH] decodebin: optimize the code a bit by avoiding unnecessary string comparisons https://bugzilla.gnome.org/show_bug.cgi?id=738416 --- gst/playback/gstdecodebin2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 079ff53464..af8e5257bd 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -2093,8 +2093,9 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, * parser is the only one that does not change the data. A * valid example for this would be multiple id3demux in a row. */ - if (strstr (gst_element_factory_get_metadata (factory, - GST_ELEMENT_METADATA_KLASS), "Parser")) { + is_parser_converter = strstr (gst_element_factory_get_metadata (factory, + GST_ELEMENT_METADATA_KLASS), "Parser") != NULL; + if (is_parser_converter) { gboolean skip = FALSE; GList *l; @@ -2125,8 +2126,6 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, continue; } - is_parser_converter = strstr (gst_element_factory_get_metadata (factory, - GST_ELEMENT_METADATA_KLASS), "Parser") != NULL; } /* emit autoplug-select to see what we should do with it. */