baseparse: estimate duration on EOS
authorVineeth TM <vineeth.tm@samsung.com>
Fri, 10 Jul 2015 00:12:15 +0000 (09:12 +0900)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 10 Jul 2015 19:23:43 +0000 (15:23 -0400)
For files which are smaller than 1.5 seconds, the duration
estimation does not happen. So the duration will always be
displayed as 0. Updating the duration on EOS when the estimation
has not happened already

https://bugzilla.gnome.org/show_bug.cgi?id=750131

libs/gst/base/gstbaseparse.c

index f42389a..19e0ada 100644 (file)
@@ -3396,6 +3396,9 @@ pause:
       push_eos = TRUE;
     }
     if (push_eos) {
+      if (parse->priv->estimated_duration <= 0) {
+        gst_base_parse_update_duration (parse);
+      }
       /* Push pending events, including SEGMENT events */
       gst_base_parse_push_pending_events (parse);