[totem/wip/hadess/screenshot: 4/8] backend: Print errors taking screenshots




commit 7a96b6644b7a7dbff6a4776791083462083a10c2
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Mar 7 12:17:09 2022 +0100

    backend: Print errors taking screenshots

 src/backend/bacon-video-widget.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index eb518944e..09db921c9 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -5358,6 +5358,9 @@ bacon_video_widget_can_get_frames (BaconVideoWidget * bvw, GError ** error)
 GdkPixbuf *
 bacon_video_widget_get_current_frame (BaconVideoWidget * bvw)
 {
+  GdkPixbuf *ret = NULL;
+  g_autoptr(GError) error = NULL;
+
   g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), NULL);
   g_return_val_if_fail (GST_IS_ELEMENT (bvw->play), NULL);
 
@@ -5368,7 +5371,12 @@ bacon_video_widget_get_current_frame (BaconVideoWidget * bvw)
     return NULL;
   }
 
-  return totem_gst_playbin_get_frame (bvw->play, NULL);
+  ret = totem_gst_playbin_get_frame (bvw->play, &error);
+  if (!ret) {
+    GST_DEBUG ("Could not take screenshot: %s", error->message);
+    g_warning ("Could not take screenshot: %s", error->message);
+  }
+  return ret;
 }
 
 /* =========================================== */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]