gst-editing-services: timeline: simplify code to remove an object from the pendingobjects list

Thibault Saunier tsaunier at kemper.freedesktop.org
Fri Jan 6 04:22:18 PST 2012


Module: gst-editing-services
Branch: master
Commit: e288a6f4604323518fae42591122228342d2c3da
URL:    http://cgit.freedesktop.org/gstreamer/gst-editing-services/commit/?id=e288a6f4604323518fae42591122228342d2c3da

Author: Robert Swain <robert.swain at gmail.com>
Date:   Fri Jan  6 09:16:09 2012 -0300

timeline: simplify code to remove an object from the pendingobjects list

g_list_remove_all () can be used as a simplification as the private data to ges
timeline object are 1:1.

---

 ges/ges-timeline.c |   15 ++-------------
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c
index c2659f6..c04185a 100644
--- a/ges/ges-timeline.c
+++ b/ges/ges-timeline.c
@@ -648,20 +648,9 @@ layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
    * it no longer needs to be discovered so remove it from the pendingobjects
    * list if it belongs to this layer */
   if (GES_IS_TIMELINE_FILE_SOURCE (object)) {
-    GList *pendingobjects;
-
     GES_TIMELINE_PENDINGOBJS_LOCK (timeline);
-    pendingobjects = timeline->priv->pendingobjects;
-
-    tmp = pendingobjects;
-    while (tmp) {
-      GList *next = tmp->next;
-
-      if (layer == (GESTimelineLayer *) ((GESTimelineObject *) tmp->data)->priv)
-        pendingobjects = g_list_delete_link (pendingobjects, tmp);
-      tmp = next;
-    }
-    timeline->priv->pendingobjects = pendingobjects;
+    timeline->priv->pendingobjects =
+        g_list_remove_all (timeline->priv->pendingobjects, object);
     GES_TIMELINE_PENDINGOBJS_UNLOCK (timeline);
   }
 



More information about the gstreamer-commits mailing list