Commit 1492465b authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

event: Update running time in QoS based on the pad offsets

https://bugzilla.gnome.org/show_bug.cgi?id=722697
parent 42cbb7c7
......@@ -1030,6 +1030,8 @@ gst_event_new_qos (GstQOSType type, gdouble proportion,
*
* Get the type, proportion, diff and timestamp in the qos event. See
* gst_event_new_qos() for more information about the different QoS values.
*
* @timestamp will be adjusted for any pad offsets of pads it was passing through.
*/
void
gst_event_parse_qos (GstEvent * event, GstQOSType * type,
......@@ -1053,10 +1055,18 @@ gst_event_parse_qos (GstEvent * event, GstQOSType * type,
*diff =
g_value_get_int64 (gst_structure_id_get_value (structure,
GST_QUARK (DIFF)));
if (timestamp)
if (timestamp) {
gint64 offset = gst_event_get_running_time_offset (event);
*timestamp =
g_value_get_uint64 (gst_structure_id_get_value (structure,
GST_QUARK (TIMESTAMP)));
/* Catch underflows */
if (*timestamp > -offset)
*timestamp += offset;
else
*timestamp = 0;
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment