diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-11-26 17:20:20 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-12-04 19:03:53 -0300 |
commit | 37a2b6110f63425188498f2539c0cf2e0e2817b4 (patch) | |
tree | 9be9f3bb1ede82ea0bcad11eddc179c3073bbf87 | |
parent | 8088d5354b9a4f90ad238b445f9b556c1dbb0cfe (diff) |
media-descriptor-writer: remove condition from inside loop
Only enter the loop if it indeed has a change of doing something
-rw-r--r-- | validate/gst/validate/media-descriptor-writer.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c index ea43bd0..b8b9387 100644 --- a/validate/gst/validate/media-descriptor-writer.c +++ b/validate/gst/validate/media-descriptor-writer.c @@ -383,13 +383,15 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, gst_pad_sticky_events_foreach (pad, (GstPadStickyEventsForeachFunction) _find_stream_id, writer); - for (tmp = ((GstMediaDescriptor *) writer)->filenode->streams; tmp; - tmp = tmp->next) { - snode = tmp->data; - if (snode->pad == pad && srcpad != pad) { - gst_object_unref (pad); - snode->pad = gst_object_ref (srcpad); - break; + if (srcpad != pad) { + for (tmp = ((GstMediaDescriptor *) writer)->filenode->streams; tmp; + tmp = tmp->next) { + snode = tmp->data; + if (snode->pad == pad) { + gst_object_unref (pad); + snode->pad = gst_object_ref (srcpad); + break; + } } } |