Buffers need not to start at running-time 0 so the last_dts needs
to be the value of the first buffer's dts as it is used to compute
the duration of the buffers. If it was left at 0 the first buffer
would have a larger duration when it shouldn't
https://bugzilla.gnome.org/show_bug.cgi?id=751361
pad->first_ts = GST_BUFFER_DTS (last_buf);
}
+ if (GST_BUFFER_DTS_IS_VALID (last_buf)) {
+ pad->last_dts = GST_BUFFER_DTS (last_buf);
+ } else if (GST_BUFFER_PTS_IS_VALID (last_buf)) {
+ pad->last_dts = GST_BUFFER_PTS (last_buf);
+ }
+
if (GST_CLOCK_TIME_IS_VALID (pad->first_ts)) {
GST_DEBUG ("setting first_ts to %" G_GUINT64_FORMAT, pad->first_ts);
} else {