gtkgstmediafile: Remove media-info-updated callback

Instead, rely on position-updated which is also called always, and also
a little later than media-info-updated, giving GstPlayer time to figure
out more of the video info. Tested on local and remote mount videos,
images, sound files.

Works around / fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3913,
https://gitlab.gnome.org/GNOME/gtk/-/issues/3914.
This commit is contained in:
Ivan Molodetskikh 2021-05-19 18:55:37 +03:00
parent fc321d8282
commit 12a9a0faf7

View File

@ -170,14 +170,6 @@ gtk_gst_media_file_position_updated_cb (GstPlayer *player,
gtk_media_stream_update (GTK_MEDIA_STREAM (self), FROM_GST_TIME (time));
}
static void
gtk_gst_media_file_media_info_updated_cb (GstPlayer *player,
GstPlayerMediaInfo *media_info,
GtkGstMediaFile *self)
{
gtk_gst_media_file_ensure_prepared (self);
}
static void
gtk_gst_media_file_seek_done_cb (GstPlayer *player,
GstClockTime time,
@ -225,7 +217,6 @@ gtk_gst_media_file_destroy_player (GtkGstMediaFile *self)
if (self->player == NULL)
return;
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_media_info_updated_cb, self);
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_position_updated_cb, self);
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_end_of_stream_cb, self);
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_seek_done_cb, self);
@ -244,7 +235,6 @@ gtk_gst_media_file_create_player (GtkGstMediaFile *file)
self->player = gst_player_new (GST_PLAYER_VIDEO_RENDERER (g_object_ref (self->paintable)),
gst_player_g_main_context_signal_dispatcher_new (NULL));
g_signal_connect (self->player, "media-info-updated", G_CALLBACK (gtk_gst_media_file_media_info_updated_cb), self);
g_signal_connect (self->player, "position-updated", G_CALLBACK (gtk_gst_media_file_position_updated_cb), self);
g_signal_connect (self->player, "end-of-stream", G_CALLBACK (gtk_gst_media_file_end_of_stream_cb), self);
g_signal_connect (self->player, "seek-done", G_CALLBACK (gtk_gst_media_file_seek_done_cb), self);