GNOME Bugzilla – Bug 779452
gstplayer: set rate continuously and the position will be wrong.
Last modified: 2018-11-03 14:05:08 UTC
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.
It may fail indefinitely if an error happened, etc. Maybe here what's best is return GST_CLOCK_TIME_NONE if the query fails.
yes, that maybe better to return GST_CLOCK_TIME_NONE.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/526.