When a running-time-offset is stored in the event, it could become smaller
than 0 although the event is otherwise correct. This can happen when pad
offsets are used.
To prevent this, we set the timestamp to -diff, so that in the end the sum of
both is exactly 0.
https://bugzilla.gnome.org/show_bug.cgi?id=754356
GST_QUARK (DIFF)));
if (timestamp) {
gint64 offset = gst_event_get_running_time_offset (event);
+ GstClockTimeDiff diff_ =
+ g_value_get_int64 (gst_structure_id_get_value (structure,
+ GST_QUARK (DIFF)));
*timestamp =
g_value_get_uint64 (gst_structure_id_get_value (structure,
*timestamp += offset;
else
*timestamp = 0;
+
+ /* Make sure that timestamp + diff is always >= 0. Because
+ * of the running time offset this might not be true */
+ if (diff_ < 0 && *timestamp < -diff_)
+ *timestamp = (GstClockTime) - diff_;
}
}