videoaggregator: fix gaps at end of streams.
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Mon, 10 Apr 2017 23:18:51 +0000 (01:18 +0200)
committerMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Thu, 6 Jul 2017 02:02:38 +0000 (04:02 +0200)
When the pad has received EOS, its buffer may still be mixed
any number of times, when the pad's framerate is inferior
to the output framerate.

This was introduced by my patch in
https://bugzilla.gnome.org/show_bug.cgi?id=782962, this patch
also correctly addresses the initial issue.

gst-libs/gst/video/gstvideoaggregator.c

index 11a3ef4..0de0bc6 100644 (file)
@@ -1219,16 +1219,16 @@ gst_video_aggregator_fill_queues (GstVideoAggregator * vagg,
       if (pad->priv->end_time != -1) {
         if (pad->priv->end_time <= output_start_running_time) {
           pad->priv->start_time = pad->priv->end_time = -1;
-          if (is_eos) {
+          if (!is_eos) {
             GST_DEBUG ("I just need more data");
             need_more_data = TRUE;
+          } else {
+            gst_buffer_replace (&pad->buffer, NULL);
           }
         } else if (is_eos) {
           eos = FALSE;
         }
-      }
-
-      if (is_eos) {
+      } else if (is_eos) {
         gst_buffer_replace (&pad->buffer, NULL);
       }
     }