From: Sebastian Dröge Date: Thu, 10 Apr 2014 07:18:05 +0000 (+0200) Subject: video-event: Update the running times in the force-keyunit events from the pad offsets X-Git-Tag: 1.19.3~511^2~4621 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c7cbeed5be2bc29f798801ea6b26ed6a3fb4659;p=platform%2Fupstream%2Fgstreamer.git video-event: Update the running times in the force-keyunit events from the pad offsets --- diff --git a/gst-libs/gst/video/video-event.c b/gst-libs/gst/video/video-event.c index 88d56f3..2776365 100644 --- a/gst-libs/gst/video/video-event.c +++ b/gst-libs/gst/video/video-event.c @@ -202,6 +202,8 @@ gst_video_event_is_force_key_unit (GstEvent * event) * key unit event. See gst_video_event_new_downstream_force_key_unit() for a * full description of the downstream force key unit event. * + * @running_time will be adjusted for any pad offsets of pads it was passing through. + * * Returns: %TRUE if the event is a valid downstream force key unit event. */ gboolean @@ -241,8 +243,16 @@ gst_video_event_parse_downstream_force_key_unit (GstEvent * event, if (stream_time) *stream_time = ev_stream_time; - if (running_time) + if (running_time) { + gint64 offset = gst_event_get_running_time_offset (event); + *running_time = ev_running_time; + /* Catch underflows */ + if (*running_time > -offset) + *running_time += offset; + else + *running_time = 0; + } if (all_headers) *all_headers = ev_all_headers; @@ -266,6 +276,8 @@ gst_video_event_parse_downstream_force_key_unit (GstEvent * event, * * Create an upstream force key unit event using gst_video_event_new_upstream_force_key_unit() * + * @running_time will be adjusted for any pad offsets of pads it was passing through. + * * Returns: %TRUE if the event is a valid upstream force-key-unit event. %FALSE if not */ gboolean @@ -294,8 +306,17 @@ gst_video_event_parse_upstream_force_key_unit (GstEvent * event, if (!gst_structure_get_uint (s, "count", &ev_count)) ev_count = 0; - if (running_time) + + if (running_time) { + gint64 offset = gst_event_get_running_time_offset (event); + *running_time = ev_running_time; + /* Catch underflows */ + if (*running_time > -offset) + *running_time += offset; + else + *running_time = 0; + } if (all_headers) *all_headers = ev_all_headers;