aggregator: fix iteration direction in skip_buffers
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 4 Aug 2020 09:13:51 +0000 (11:13 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Tue, 4 Aug 2020 09:16:21 +0000 (11:16 +0200)
Subclasses use the pad segment to determine whether a buffer
should be skipped, we thus don't want to check if a buffer
needs to be skipped before processing the segment it's part
of.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/585>

libs/gst/base/gstaggregator.c

index 951cb7b..adb8596 100644 (file)
@@ -944,9 +944,9 @@ gst_aggregator_pad_skip_buffers (GstElement * self, GstPad * epad,
 
   PAD_LOCK (aggpad);
 
-  item = g_queue_peek_head_link (&aggpad->priv->data);
+  item = g_queue_peek_tail_link (&aggpad->priv->data);
   while (item) {
-    GList *next = item->next;
+    GList *prev = item->prev;
 
     if (GST_IS_BUFFER (item->data)
         && klass->skip_buffer (aggpad, agg, item->data)) {
@@ -958,7 +958,7 @@ gst_aggregator_pad_skip_buffers (GstElement * self, GstPad * epad,
       break;
     }
 
-    item = next;
+    item = prev;
   }
 
   PAD_UNLOCK (aggpad);