mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 10:10:32 +00:00
gstplay: query duration again if previous query failed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6668>
This commit is contained in:
parent
5179cbccfa
commit
13e17b9149
1 changed files with 9 additions and 0 deletions
|
@ -1443,6 +1443,15 @@ state_changed_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg,
|
|||
}
|
||||
} else if (new_state == GST_STATE_PLAYING
|
||||
&& pending_state == GST_STATE_VOID_PENDING) {
|
||||
/* Try to query duration again if needed */
|
||||
if (self->cached_duration == GST_CLOCK_TIME_NONE) {
|
||||
gint64 duration = -1;
|
||||
|
||||
if (gst_element_query_duration (self->playbin, GST_FORMAT_TIME,
|
||||
&duration)) {
|
||||
on_duration_changed (self, duration);
|
||||
}
|
||||
}
|
||||
/* api_bus_post_message (self, GST_PLAY_MESSAGE_POSITION_UPDATED, */
|
||||
/* GST_PLAY_MESSAGE_DATA_POSITION, GST_TYPE_CLOCK_TIME, 0, NULL); */
|
||||
|
||||
|
|
Loading…
Reference in a new issue