diff options
author | Edward Hervey <bilboed@bilboed.com> | 2016-12-19 16:17:56 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2016-12-19 16:48:22 +0100 |
commit | 35a848c4b271b18d5f4efa12925e44fa2b6dadcf (patch) | |
tree | 34295b069935f106e28815b8eca2f6b8bb6164bd | |
parent | 6a138a955797af7629eaf5cf6d22018f9b6dc792 (diff) |
validate-scenario: Properly get the rate for action validation
This issue was most likely introduced by the refactoring of the
position querying into a standalone function.
In execute_next_action() the rate variable was never replaced by
the current rate of the pipeline, this would result in all reverse
playback actions to trigger immediately instead of waiting for
the actual target time.
https://bugzilla.gnome.org/show_bug.cgi?id=776280
-rw-r--r-- | validate/gst/validate/gst-validate-scenario.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 2dbdb2a..9f43a98 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -1352,10 +1352,9 @@ _get_position (GstValidateScenario * scenario, static gboolean _check_position (GstValidateScenario * scenario, GstValidateAction * act, - GstClockTime * position) + GstClockTime * position, gdouble * rate) { GstQuery *query; - gdouble rate; GstClockTime start_with_tolerance, stop_with_tolerance; GstValidateScenarioPrivate *priv = scenario->priv; @@ -1393,15 +1392,15 @@ _check_position (GstValidateScenario * scenario, GstValidateAction * act, query = gst_query_new_segment (GST_FORMAT_DEFAULT); if (gst_element_query (GST_ELEMENT (scenario->pipeline), query)) - gst_query_parse_segment (query, &rate, NULL, NULL, NULL); + gst_query_parse_segment (query, rate, NULL, NULL, NULL); gst_query_unref (query); if (priv->seeked_in_pause && priv->seek_flags & GST_SEEK_FLAG_ACCURATE) { - if ((rate > 0 && (*position >= priv->segment_start + priv->seek_pos_tol || + if ((*rate > 0 && (*position >= priv->segment_start + priv->seek_pos_tol || *position < ((priv->segment_start < priv->seek_pos_tol) ? 0 : priv->segment_start - priv->seek_pos_tol))) - || (rate < 0 && (*position > priv->segment_start + priv->seek_pos_tol + || (*rate < 0 && (*position > priv->segment_start + priv->seek_pos_tol || *position < ((priv->segment_start < priv->seek_pos_tol) ? 0 : priv->segment_start - priv->seek_pos_tol)))) { @@ -1782,7 +1781,7 @@ execute_next_action (GstValidateScenario * scenario) } } - if (!_check_position (scenario, act, &position)) + if (!_check_position (scenario, act, &position, &rate)) return G_SOURCE_CONTINUE; if (!_should_execute_action (scenario, act, position, rate)) { |