summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-11-26 17:20:20 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-12-04 19:03:53 -0300
commit37a2b6110f63425188498f2539c0cf2e0e2817b4 (patch)
tree9be9f3bb1ede82ea0bcad11eddc179c3073bbf87
parent8088d5354b9a4f90ad238b445f9b556c1dbb0cfe (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.c16
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;
+ }
}
}