diff options
author | Gaël Bonithon <gael@xfce.org> | 2021-12-17 12:18:45 +0100 |
---|---|---|
committer | Gaël Bonithon <gael@xfce.org> | 2021-12-17 15:42:57 +0100 |
commit | 71cbd765ecd904c260dcfdcd468bdd263c438c08 (patch) | |
tree | 80c17d8303489845c712c6343815c61162e54568 /plugins | |
parent | d6aeb7d65acf6e41738c78b9d137fab3502d1c58 (diff) | |
download | tumbler-71cbd765ecd904c260dcfdcd468bdd263c438c08.tar.gz |
ffmpeg-thumbnailer: Fix error handling
Ensures that Tumbler emits the "error" signal if the pixbuf generation
didn't succeed and wasn't cancelled before the plugin handles the
request.
Similar to 3eeec3c58adc0b2761d8d0dd3cdd4f6ac62ef6d7, related to #10.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c b/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c index 6e9c03c..fb925c5 100644 --- a/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c +++ b/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c @@ -190,10 +190,17 @@ ffmpeg_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, return; /* Check if is a sparse video file */ + uri = tumbler_file_info_get_uri (info); if (tumbler_util_guess_is_sparse (info)) { - g_debug ("Video file '%s' is probably sparse, skipping\n", - tumbler_file_info_get_uri (info)); + g_debug ("Video file '%s' is probably sparse, skipping\n", uri); + + /* there was an error, emit error signal */ + g_set_error (&error, TUMBLER_ERROR, TUMBLER_ERROR_NO_CONTENT, + TUMBLER_ERROR_MESSAGE_CREATION_FAILED); + g_signal_emit_by_name (thumbnailer, "error", uri, error->code, error->message); + g_error_free (error); + return; } @@ -212,8 +219,6 @@ ffmpeg_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, #endif v_data = video_thumbnailer_create_image_data (); - uri = tumbler_file_info_get_uri (info); - /* get the local absolute path to the source file */ file = g_file_new_for_uri (uri); path = g_file_get_path (file); |