summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-04-02 07:55:02 +0200
committerBenjamin Otte <otte@redhat.com>2018-04-05 14:56:39 +0200
commitc74854fe49841b478ce32bc064aa07de82bb9abb (patch)
treed2cdf176a31642dd2b70640ea26180abb42a2310 /modules
parentffc7b2bb0afd04cacbe45cff6f27eb5d644d5b2b (diff)
downloadgtk+-c74854fe49841b478ce32bc064aa07de82bb9abb.tar.gz
paintable: Introduce gdk_paintable_new_empty()
Also, use it where appropriate.
Diffstat (limited to 'modules')
-rw-r--r--modules/media/gtkffmediafile.c8
-rw-r--r--modules/media/gtkgstpaintable.c3
2 files changed, 9 insertions, 2 deletions
diff --git a/modules/media/gtkffmediafile.c b/modules/media/gtkffmediafile.c
index 46011e00d1..4ae1621575 100644
--- a/modules/media/gtkffmediafile.c
+++ b/modules/media/gtkffmediafile.c
@@ -114,6 +114,14 @@ gtk_ff_media_file_paintable_get_current_image (GdkPaintable *paintable)
{
GtkFfMediaFile *video = GTK_FF_MEDIA_FILE (paintable);
+ if (gtk_video_frame_ffmpeg_is_empty (&video->current_frame))
+ {
+ if (video->codec_ctx)
+ return gdk_paintable_new_empty (video->codec_ctx->width, video->codec_ctx->height);
+ else
+ return gdk_paintable_new_empty (0, 0);
+ }
+
return GDK_PAINTABLE (g_object_ref (video->current_frame.texture));
}
diff --git a/modules/media/gtkgstpaintable.c b/modules/media/gtkgstpaintable.c
index 980459a34d..838b688db5 100644
--- a/modules/media/gtkgstpaintable.c
+++ b/modules/media/gtkgstpaintable.c
@@ -57,8 +57,7 @@ gtk_gst_paintable_paintable_get_current_image (GdkPaintable *paintable)
if (self->image)
return GDK_PAINTABLE (g_object_ref (self->image));
- g_warning ("FIXME: return empty something here");
- return NULL;
+ return gdk_paintable_new_empty (0, 0);
}
static int