diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-04-04 17:28:23 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-04-10 08:25:50 +0200 |
commit | 1492465b89961622947c2c41a454c5e7f61b6b61 (patch) | |
tree | e96cc5120b76930bce280f56a9af9277b3eddb0b | |
parent | 42cbb7c7c70126b781cf730977fa85986d5a95ed (diff) |
event: Update running time in QoS based on the pad offsets
https://bugzilla.gnome.org/show_bug.cgi?id=722697
-rw-r--r-- | gst/gstevent.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gst/gstevent.c b/gst/gstevent.c index f31d3ed9d..7289bbd8e 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -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; + } } /** |