summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-12-18 02:04:54 +0100
committerBenjamin Otte <otte@redhat.com>2018-12-18 02:04:54 +0100
commit142326561017178711f170a52f4e1213d4aca3d8 (patch)
treecf2e24a846341dfc88c9a2b3af7f9de074a4282a /modules
parent89c48a08a0fe333644b3a888e465d34fd3a8af99 (diff)
downloadgtk+-142326561017178711f170a52f4e1213d4aca3d8.tar.gz
gstmedia: Implement error handling.
I wonder who forgot that. Whoops.
Diffstat (limited to 'modules')
-rw-r--r--modules/media/gtkgstmediafile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/media/gtkgstmediafile.c b/modules/media/gtkgstmediafile.c
index afbf637bd3..745ba3bc88 100644
--- a/modules/media/gtkgstmediafile.c
+++ b/modules/media/gtkgstmediafile.c
@@ -159,6 +159,18 @@ gtk_gst_media_file_seek_done_cb (GstPlayer *player,
}
static void
+gtk_gst_media_file_error_cb (GstPlayer *player,
+ GError *error,
+ GtkGstMediaFile *self)
+{
+ if (gtk_media_stream_get_error (GTK_MEDIA_STREAM (self)))
+ return;
+
+ gtk_media_stream_gerror (GTK_MEDIA_STREAM (self),
+ g_error_copy (error));
+}
+
+static void
gtk_gst_media_file_end_of_stream_cb (GstPlayer *player,
GtkGstMediaFile *self)
{
@@ -184,6 +196,7 @@ gtk_gst_media_file_destroy_player (GtkGstMediaFile *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);
+ g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_error_cb, self);
g_object_unref (self->player);
self->player = NULL;
}
@@ -202,6 +215,7 @@ gtk_gst_media_file_create_player (GtkGstMediaFile *file)
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);
+ g_signal_connect (self->player, "error", G_CALLBACK (gtk_gst_media_file_error_cb), self);
}
static void