gstplayer: set rate continuously and the position will be wrong.
Submitted by Lyon
Link to original bug (#779452)
Description
When I tried to set rate immediately after first my first set rate action.
The play position will jump to 0 to play.
Checked gst_player_set_rate_internal(), It will first call gst_player_get_position()
however, I found that the 2nd time get position return might be zero if the first set_rate (or seek) is not yet finished.
case PROP_POSITION:{
gint64 position = 0;
gst_element_query_position (self->playbin, GST_FORMAT_TIME, &position);
g_value_set_uint64 (value, position);
GST_TRACE_OBJECT (self, "Returning position=%" GST_TIME_FORMAT,
GST_TIME_ARGS (g_value_get_uint64 (value)));
break;
}
Actually, the second time when getting the position, gst_element_query_position() return is FALSE means the query is failed. and the position is remain 0 to be got.
That's why after 2nd set rate operation, the play position will jump to 0.
Will it be a possible solution here to using a while loop to check the gst_element_query_position() return TRUE, and set the correct position.
Version: 1.10.x