diff options
author | Benjamin Otte <otte.benjamin@googlemail.com> | 2021-03-29 15:41:55 +0000 |
---|---|---|
committer | Benjamin Otte <otte.benjamin@googlemail.com> | 2021-03-29 15:41:55 +0000 |
commit | 6569a877d828d0c31b4349373b8363b2fe480456 (patch) | |
tree | 2001c2ce279c344b2538b28380d736e5f1ac80f9 /modules | |
parent | b21fba117f2f2b1d6cf7eaf24ea4118948b809d9 (diff) | |
parent | 38fff37daec3c8ec679717c93650fed2a5999bde (diff) | |
download | gtk+-6569a877d828d0c31b4349373b8363b2fe480456.tar.gz |
Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master
Closes #3810
See merge request GNOME/gtk!3366
Diffstat (limited to 'modules')
-rw-r--r-- | modules/media/gtkgstmediafile.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/modules/media/gtkgstmediafile.c b/modules/media/gtkgstmediafile.c index 6382f3b10a..7edc682e9c 100644 --- a/modules/media/gtkgstmediafile.c +++ b/modules/media/gtkgstmediafile.c @@ -127,10 +127,26 @@ g_io_module_query (void) } static void +gtk_gst_media_file_ensure_prepared (GtkGstMediaFile *self, + gint64 duration) +{ + if (gtk_media_stream_is_prepared (GTK_MEDIA_STREAM (self))) + return; + + gtk_media_stream_prepared (GTK_MEDIA_STREAM (self), + TRUE, + TRUE, + TRUE, + duration); +} + +static void gtk_gst_media_file_position_updated_cb (GstPlayer *player, GstClockTime time, GtkGstMediaFile *self) { + gtk_gst_media_file_ensure_prepared (self, 0); + gtk_media_stream_update (GTK_MEDIA_STREAM (self), FROM_GST_TIME (time)); } @@ -139,14 +155,7 @@ gtk_gst_media_file_duration_changed_cb (GstPlayer *player, GstClockTime duration, GtkGstMediaFile *self) { - if (gtk_media_stream_is_prepared (GTK_MEDIA_STREAM (self))) - return; - - gtk_media_stream_prepared (GTK_MEDIA_STREAM (self), - TRUE, - TRUE, - TRUE, - FROM_GST_TIME (duration)); + gtk_gst_media_file_ensure_prepared (self, FROM_GST_TIME (duration)); } static void @@ -176,6 +185,8 @@ static void gtk_gst_media_file_end_of_stream_cb (GstPlayer *player, GtkGstMediaFile *self) { + gtk_gst_media_file_ensure_prepared (self, 0); + if (gtk_media_stream_get_ended (GTK_MEDIA_STREAM (self))) return; |